Reduce unnecessary array allocations

~8% speed-up.