lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r565368 - in /lucene/java/trunk/src/java/org/apache/lucene: analysis/CharArraySet.java index/DocumentsWriter.java
Date Mon, 13 Aug 2007 14:59:04 GMT
Author: yonik
Date: Mon Aug 13 07:59:03 2007
New Revision: 565368

URL: http://svn.apache.org/viewvc?view=rev&rev=565368
Log:
LUCENE-977: internal hashing improvements

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/analysis/CharArraySet.java
    lucene/java/trunk/src/java/org/apache/lucene/index/DocumentsWriter.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/analysis/CharArraySet.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/analysis/CharArraySet.java?view=diff&rev=565368&r1=565367&r2=565368
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/analysis/CharArraySet.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/analysis/CharArraySet.java Mon Aug 13 07:59:03
2007
@@ -55,7 +55,7 @@
     int pos = code & mask;
     char[] text2 = entries[pos];
     if (text2 != null && !equals(text, len, text2)) {
-      final int inc = code*1347|1;
+      final int inc = ((code>>8)+code)|1;
       do {
         code += inc;
         pos = code & mask;
@@ -79,7 +79,7 @@
     int pos = code & mask;
     char[] text2 = entries[pos];
     if (text2 != null) {
-      final int inc = code*1347|1;
+      final int inc = ((code>>8)+code)|1;
       do {
         code += inc;
         pos = code & mask;
@@ -120,7 +120,7 @@
         int code = getHashCode(text, text.length);
         int pos = code & mask;
         if (newEntries[pos] != null) {
-          final int inc = code*1347|1;
+          final int inc = ((code>>8)+code)|1;
           do {
             code += inc;
             pos = code & mask;

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/DocumentsWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/DocumentsWriter.java?view=diff&rev=565368&r1=565367&r2=565368
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/DocumentsWriter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/DocumentsWriter.java Mon Aug 13 07:59:03
2007
@@ -1375,7 +1375,7 @@
         if (p != null && !postingEquals(tokenText, tokenTextLen)) {
           // Conflict: keep searching different locations in
           // the hash table.
-          final int inc = code*1347|1;
+          final int inc = ((code>>8)+code)|1;
           do {
             code += inc;
             hashPos = code & postingsHashMask;
@@ -1550,7 +1550,7 @@
             int hashPos = code & postingsHashMask;
             assert hashPos >= 0;
             if (newHash[hashPos] != null) {
-              final int inc = code*1347|1;
+              final int inc = ((code>>8)+code)|1;
               do {
                 code += inc;
                 hashPos = code & postingsHashMask;



Mime
View raw message