another performance hack

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7989 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 13 years ago
parent 7df0643f0e
commit 1df43b137d

@ -152,15 +152,15 @@ public final class NaturalOrder extends AbstractOrder<byte[]> implements ByteOrd
// with filled-up char(0)-values
public final int compare(final byte[] a, final byte[] b) {
if (a.length == b.length) {
return (this.asc) ? compare0(a, 0, b, 0, a.length) : compare0(b, 0, a, 0, a.length);
return (this.asc) ? compare0(a, b, a.length) : compare0(b, 0, a, 0, a.length);
}
final int length = Math.min(a.length, b.length);
if (this.asc) {
final int c = compare0(a, 0, b, 0, length);
final int c = compare0(a, b, length);
if (c != 0) return c;
return (a.length > b.length) ? 1 : -1;
}
final int c = compare0(b, 0, a, 0, length);
final int c = compare0(b, a, length);
if (c != 0) return c;
return (a.length > b.length) ? -1 : 1;
}

Loading…
Cancel
Save