Mercurial > hg4j
changeset 301:88c58edc0857
Remarks about sorting order
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Sat, 17 Sep 2011 14:00:48 +0200 |
parents | 650b45d290b1 |
children | a7a3395a519e |
files | src/org/tmatesoft/hg/core/Nodeid.java |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
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; } }