News for hackers. Stuff that matters.
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.

Re:Just fixed a 20-year-old bug… by viraptor on Sunday August 28, 2011 @06:03PM (#2935122)
I thought it might too, but then he writes:

"A zero result means equals, and non-zero means not-equals… and then the results are cast to 32 bits."

So he didn't care about ordering.