refactor: refactor the array creation and preallocate
refactor: refactor the array creation and preallocate

This may have a marginal speedup improvement to avoid the need to
reallocate.

Kitware/VeloView,frizaro/Veloview,frizaro/Veloview,frizaro/Veloview,Kitware/VeloView,frizaro/Veloview,Kitware/VeloView,Kitware/VeloView,Kitware/VeloView