Minor refactor - Uses Enumerable#to_a instead of iterate and add to an
array
Merge pull request #11625 from phstc/minor-refactor-code-gardener-grouping

Minor refactor - Uses Enumerable#to_a instead of iterate and add to an array