groovy

Avoid too many temporary arrays with each and eachWithIndex