Commit e8e563b
authored
[ADT] Reduce code duplication in SmallDenseMap (NFC) (#160813)
This patch reduces code duplication by having allocateBuckets take a
larger role. Specifically, allocateBuckets now checks to see if we
need to allocate heap memory and initializes Small appropriately.
With this patch, allocateBuckets mirrors deallocateBuckets cleanly.
Both methods handle the Small mode without asserting and are
responsible for constructing and destructing LargeRep.1 parent 446b9dc commit e8e563b
1 file changed
+13
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1009 | 1009 | | |
1010 | 1010 | | |
1011 | 1011 | | |
1012 | | - | |
1013 | | - | |
1014 | | - | |
1015 | | - | |
1016 | | - | |
| 1012 | + | |
1017 | 1013 | | |
1018 | 1014 | | |
1019 | 1015 | | |
1020 | 1016 | | |
1021 | 1017 | | |
1022 | | - | |
1023 | | - | |
1024 | | - | |
1025 | | - | |
1026 | | - | |
| 1018 | + | |
1027 | 1019 | | |
1028 | 1020 | | |
1029 | 1021 | | |
| |||
1057 | 1049 | | |
1058 | 1050 | | |
1059 | 1051 | | |
1060 | | - | |
1061 | | - | |
1062 | | - | |
1063 | | - | |
| 1052 | + | |
1064 | 1053 | | |
1065 | 1054 | | |
1066 | 1055 | | |
1067 | 1056 | | |
1068 | 1057 | | |
1069 | 1058 | | |
1070 | | - | |
1071 | | - | |
1072 | | - | |
1073 | | - | |
1074 | | - | |
| 1059 | + | |
1075 | 1060 | | |
1076 | 1061 | | |
1077 | 1062 | | |
| |||
1166 | 1151 | | |
1167 | 1152 | | |
1168 | 1153 | | |
1169 | | - | |
1170 | | - | |
1171 | | - | |
1172 | | - | |
1173 | | - | |
1174 | | - | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
1175 | 1163 | | |
1176 | 1164 | | |
1177 | 1165 | | |
| |||
0 commit comments