Redundant. I don't think the time savings due to not calculating distance, if any, are worth it.
In fact, this might even save some time. Calculating distance may be faster than iterating through memory twice.
In fact, this might even save some time. Calculating distance may be faster than iterating through memory twice.