Author: cutting Date: Thu Sep 1 22:32:54 2005 New Revision: 266289 URL: http://svn.apache.org/viewcvs?rev=266289&view=rev Log: Fixes to comparator.
Modified: lucene/nutch/branches/mapred/src/java/org/apache/nutch/crawl/Generator.java Modified: lucene/nutch/branches/mapred/src/java/org/apache/nutch/crawl/Generator.java URL: http://svn.apache.org/viewcvs/lucene/nutch/branches/mapred/src/java/org/apache/nutch/crawl/Generator.java?rev=266289&r1=266288&r2=266289&view=diff ============================================================================== --- lucene/nutch/branches/mapred/src/java/org/apache/nutch/crawl/Generator.java (original) +++ lucene/nutch/branches/mapred/src/java/org/apache/nutch/crawl/Generator.java Thu Sep 1 22:32:54 2005 @@ -117,12 +117,14 @@ public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) { - int hash1 = hash(b1, s1, l1); - int hash2 = hash(b2, s2, l2); + int n1 = readUnsignedShort(b1, s1); + int n2 = readUnsignedShort(b2, s2); + int hash1 = hash(b1, s1+2, n1); + int hash2 = hash(b2, s2+2, n2); if (hash1 != hash2) { return hash1 - hash2; } - return compareBytes(b1, s1+2, l1, b2, s2+2, l2); + return compareBytes(b1, s1+2, n1, b2, s2+2, n2); } private static int hash(byte[] bytes, int start, int length) {