Use for-loop instead of Array.prototype.filter.

Speed up a bit.