Remove some Vec allocations to improve performance
#71268
Merged
Vec allocations to improve performance
#71268