Commit 54615fe
Refactor ClearBackingArray and add test for clearing with different sizes.
This change refactors the "no reuse" logic from ClearBackingArray into a new helper function ClearBackingArrayNoReuse. It also clarifies that ClearBackingArray is only applicable to tables with capacity greater than MaxSmallCapacity(), adding asserts and checks to enforce this.
PiperOrigin-RevId: 920163391
Change-Id: I22b5fe24d796b00fc1231d4e42720d58a2a7aa601 parent e9f87bc commit 54615fe
3 files changed
Lines changed: 55 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
616 | 616 | | |
617 | 617 | | |
618 | 618 | | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
619 | 637 | | |
620 | 638 | | |
621 | 639 | | |
| |||
649 | 667 | | |
650 | 668 | | |
651 | 669 | | |
652 | | - | |
| 670 | + | |
| 671 | + | |
653 | 672 | | |
654 | 673 | | |
655 | | - | |
656 | 674 | | |
657 | 675 | | |
658 | 676 | | |
659 | 677 | | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
| 678 | + | |
668 | 679 | | |
669 | 680 | | |
670 | 681 | | |
| |||
1835 | 1846 | | |
1836 | 1847 | | |
1837 | 1848 | | |
1838 | | - | |
1839 | | - | |
| 1849 | + | |
1840 | 1850 | | |
1841 | 1851 | | |
1842 | 1852 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1938 | 1938 | | |
1939 | 1939 | | |
1940 | 1940 | | |
1941 | | - | |
| 1941 | + | |
1942 | 1942 | | |
1943 | | - | |
| 1943 | + | |
1944 | 1944 | | |
1945 | 1945 | | |
1946 | 1946 | | |
| |||
2917 | 2917 | | |
2918 | 2918 | | |
2919 | 2919 | | |
2920 | | - | |
2921 | | - | |
| 2920 | + | |
| 2921 | + | |
2922 | 2922 | | |
2923 | 2923 | | |
2924 | 2924 | | |
| |||
3273 | 3273 | | |
3274 | 3274 | | |
3275 | 3275 | | |
3276 | | - | |
3277 | | - | |
3278 | | - | |
| 3276 | + | |
| 3277 | + | |
3279 | 3278 | | |
3280 | 3279 | | |
3281 | 3280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1165 | 1165 | | |
1166 | 1166 | | |
1167 | 1167 | | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
1168 | 1195 | | |
1169 | 1196 | | |
1170 | 1197 | | |
| |||
0 commit comments