
Originally Posted by
dgorsman
I would factor out the the process of extracting the coordinates away from the sort function - the coordinates will not change during the sorting so there isn't much need to get them over and over. Consider extracting the coordinates to a separate list first (perhaps even just the X-coordinate but include the Y if its needed as a tie-breaker), then calling for the sort.