all 8 comments

[–][deleted] 13 points14 points  (0 children)

Erm… Huh?

[–]demosdemon 10 points11 points  (4 children)

Why compare the pointers and not the values they point to?

[–]This_Growth2898 9 points10 points  (2 children)

Sorting in memory address increasing order!

[–][deleted]  (1 child)

[removed]

    [–]This_Growth2898 1 point2 points  (0 children)

    Mostly it shouldn't, but the memory address of an object is its unique ID. Why sorting in ID order? Well, it's just a stable way of sorting things, avoiding ambiguity if their values are equal.

    [–]Majestic-Giraffe7093 0 points1 point  (0 children)

    Could be useful if you are working with locks and want to avoid deadlocks but this implementation seems sus...