In reply to Ian Wakeling.

Additions are very cheap. Also, the solution with the LOC function requires more temporary arrays (memory allocations).