Simplifying the "locality min / max" operations on arrays by factoring out the locality only logic.