Replace array.map() by array.forEach()

As told by @q-- in #376 replace array.map() by array.forEach() because
it's faster and the array returned by map() is not used
Merge pull request #378 from gadcam/master

Replace array.map() by array.forEach()