Change from `map` => `map!` and `collect!` to save creation of extra array.
Merge pull request #11678 from vipulnsward/helper_destructive

Change from `map` => `map!` and `collect!` to save creation of extra array