refactor initialization of array
Merge pull request #10318 from vipulnsward/refactor_obvious

refactor initialization of array