diff --git a/src/java/org/apache/lucene/analysis/CharArraySet.java b/src/java/org/apache/lucene/analysis/CharArraySet.java index 5307d73282c..970e77aeb52 100644 --- a/src/java/org/apache/lucene/analysis/CharArraySet.java +++ b/src/java/org/apache/lucene/analysis/CharArraySet.java @@ -55,7 +55,7 @@ final class CharArraySet { 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 @@ final class CharArraySet { 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 @@ final class CharArraySet { 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; diff --git a/src/java/org/apache/lucene/index/DocumentsWriter.java b/src/java/org/apache/lucene/index/DocumentsWriter.java index ed6737e673a..bf002099ca7 100644 --- a/src/java/org/apache/lucene/index/DocumentsWriter.java +++ b/src/java/org/apache/lucene/index/DocumentsWriter.java @@ -1375,7 +1375,7 @@ final class DocumentsWriter { 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 @@ final class DocumentsWriter { 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;