Commit e0f80d8
promisor-remote: keep accepted promisor_info structs alive
In filter_promisor_remote(), the instances of `struct promisor_info`
for accepted remotes are dismantled into separate parallel data
structures (the 'accepted' strvec for server names, and
'accepted_filters' for filter strings) and then immediately freed.
Instead, let's keep these instances on an 'accepted_remotes' list.
This way the post-loop phase can iterate a single list to build the
protocol reply, apply advertised filters, and mark remotes as
accepted, rather than iterating three separate structures.
This refactoring also prepares for a future commit that will add a
'local_name' member to 'struct promisor_info'. Since struct instances
stay alive, downstream code will be able to simply read both names
from them rather than needing yet another parallel strvec.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 7557a56 commit e0f80d8
1 file changed
Lines changed: 17 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
890 | 890 | | |
891 | 891 | | |
892 | 892 | | |
| 893 | + | |
893 | 894 | | |
894 | 895 | | |
895 | 896 | | |
896 | | - | |
897 | 897 | | |
898 | 898 | | |
899 | 899 | | |
| |||
922 | 922 | | |
923 | 923 | | |
924 | 924 | | |
925 | | - | |
926 | | - | |
927 | | - | |
928 | | - | |
929 | | - | |
930 | | - | |
931 | | - | |
932 | | - | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
933 | 928 | | |
934 | | - | |
935 | | - | |
936 | 929 | | |
937 | 930 | | |
938 | 931 | | |
| |||
942 | 935 | | |
943 | 936 | | |
944 | 937 | | |
945 | | - | |
946 | | - | |
947 | | - | |
948 | | - | |
949 | | - | |
950 | | - | |
951 | | - | |
952 | | - | |
953 | | - | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
954 | 942 | | |
955 | | - | |
| 943 | + | |
956 | 944 | | |
957 | | - | |
958 | | - | |
959 | | - | |
960 | | - | |
| 945 | + | |
961 | 946 | | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
962 | 952 | | |
| 953 | + | |
| 954 | + | |
963 | 955 | | |
964 | 956 | | |
965 | 957 | | |
| |||
0 commit comments