Mercurial > jhg
diff src/org/tmatesoft/hg/core/Nodeid.java @ 301:88c58edc0857
Remarks about sorting order
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Sat, 17 Sep 2011 14:00:48 +0200 |
parents | 0a2f445de774 |
children | 85b8efde5586 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/core/Nodeid.java Sat Sep 17 13:41:04 2011 +0200 +++ b/src/org/tmatesoft/hg/core/Nodeid.java Sat Sep 17 14:00:48 2011 +0200 @@ -92,6 +92,9 @@ } for (int i = 0; i < 20; i++) { if (binaryData[i] != o.binaryData[i]) { + // if we need truly ascending sort, need to respect byte sign + // return (binaryData[i] & 0xFF) < (o.binaryData[i] & 0xFF) ? -1 : 1; + // however, for our purposes partial sort is pretty enough return binaryData[i] < o.binaryData[i] ? -1 : 1; } }