Re:Just fixed a 20-year-old bug…
by lukesandberg on Sunday August 28, 2011 @05:54PM
(#2935095)
I think the point is that he needed a comparison function not and equals function. thus the subtraction. Erric Lippert had a nice series on subtle bugs in compareTo implementations, in part3 he talks about a similar version of this bug. http://blogs.msdn.com/b/ericlippert/archive/2011/01/27/spot-...
tldr; if you aren't doing a comparison in your compareTo implementation, you probably have a bug.
tldr; if you aren't doing a comparison in your compareTo implementation, you probably have a bug.