Commit cde2816
Remove unneeded uses of indexmap (#1048)
We initially adopted `indexmap` in many places where it's not strictly
necessary: we don't actually rely on the data being insert-ordered and
don't need to mutate the structure while iterating over it. In fact, the
traffic split module is the only place in the codebase where we access
the data structure by index (rather than by key).
In all other cases, we do not care about insertion-order. In the vast
majority of cases we can simply use a `HashMap`. Endpoint and route
labels need to be reliably ordered so that they can be compared (i.e.
implementing `Eq`), in which case the standard `BTreeMap` works
sufficiently.
This change eliminates unnecessary uses of `indexmap` to reduce
dependency and conceptual overhead.
Co-authored-by: Eliza Weisman <[email protected]>1 parent 7066e7d commit cde2816
File tree
32 files changed
+112
-137
lines changed- linkerd
- app
- core
- gateway
- inbound
- src
- outbound
- src
- http
- tcp
- src
- error-metrics
- src
- http-metrics
- src/requests
- metrics
- src
- proxy
- api-resolve
- src
- http
- tap
- src
- grpc
- service-profiles/src/http
- stack/metrics
- src
32 files changed
+112
-137
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
618 | 618 | | |
619 | 619 | | |
620 | 620 | | |
621 | | - | |
622 | 621 | | |
623 | 622 | | |
624 | 623 | | |
| |||
663 | 662 | | |
664 | 663 | | |
665 | 664 | | |
666 | | - | |
667 | 665 | | |
668 | 666 | | |
669 | 667 | | |
| |||
723 | 721 | | |
724 | 722 | | |
725 | 723 | | |
726 | | - | |
727 | 724 | | |
728 | 725 | | |
729 | 726 | | |
| |||
745 | 742 | | |
746 | 743 | | |
747 | 744 | | |
748 | | - | |
749 | 745 | | |
750 | 746 | | |
751 | 747 | | |
| |||
796 | 792 | | |
797 | 793 | | |
798 | 794 | | |
799 | | - | |
800 | 795 | | |
801 | 796 | | |
802 | 797 | | |
| |||
931 | 926 | | |
932 | 927 | | |
933 | 928 | | |
934 | | - | |
935 | 929 | | |
936 | 930 | | |
937 | 931 | | |
| |||
992 | 986 | | |
993 | 987 | | |
994 | 988 | | |
995 | | - | |
996 | 989 | | |
997 | 990 | | |
998 | 991 | | |
| |||
1056 | 1049 | | |
1057 | 1050 | | |
1058 | 1051 | | |
1059 | | - | |
1060 | 1052 | | |
1061 | 1053 | | |
1062 | 1054 | | |
| |||
1088 | 1080 | | |
1089 | 1081 | | |
1090 | 1082 | | |
1091 | | - | |
1092 | 1083 | | |
1093 | 1084 | | |
1094 | 1085 | | |
| |||
1158 | 1149 | | |
1159 | 1150 | | |
1160 | 1151 | | |
1161 | | - | |
1162 | 1152 | | |
1163 | 1153 | | |
1164 | 1154 | | |
| |||
1216 | 1206 | | |
1217 | 1207 | | |
1218 | 1208 | | |
1219 | | - | |
1220 | 1209 | | |
1221 | 1210 | | |
1222 | 1211 | | |
| |||
1357 | 1346 | | |
1358 | 1347 | | |
1359 | 1348 | | |
1360 | | - | |
1361 | 1349 | | |
1362 | 1350 | | |
1363 | 1351 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | | - | |
| 3 | + | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
11 | | - | |
| 10 | + | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | 2 | | |
4 | 3 | | |
| |||
279 | 278 | | |
280 | 279 | | |
281 | 280 | | |
282 | | - | |
| 281 | + | |
283 | 282 | | |
284 | 283 | | |
285 | 284 | | |
286 | 285 | | |
287 | 286 | | |
288 | 287 | | |
289 | 288 | | |
290 | | - | |
| 289 | + | |
291 | 290 | | |
292 | 291 | | |
293 | 292 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
| 185 | + | |
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
| 233 | + | |
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
173 | 172 | | |
174 | 173 | | |
175 | 174 | | |
176 | | - | |
| 175 | + | |
177 | 176 | | |
178 | 177 | | |
179 | 178 | | |
180 | 179 | | |
181 | 180 | | |
182 | 181 | | |
183 | 182 | | |
184 | | - | |
| 183 | + | |
185 | 184 | | |
186 | 185 | | |
187 | 186 | | |
| |||
0 commit comments