Reuse (optimized) reduce and reduceRight iteration