replaced one forEach with map
Merge pull request #137 from Pomax/bug882148

replaced one forEach with map