Whenever possible, preallocate array to the correct size instead of letting arrays "grow". This reduces the load on the Garbage Collector and improves memory usage efficiency.
Checklist
[x] My code follows the style guidelines of this project
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have added tests that prove my fix is effective or that my feature works
What does this PR do?
Whenever possible, preallocate array to the correct size instead of letting arrays "grow". This reduces the load on the Garbage Collector and improves memory usage efficiency.
Checklist
I have commented my code, particularly in hard-to-understand areasI have added tests that prove my fix is effective or that my feature worksI have added an entry inCHANGELOG.md