LUCENE-977: internal hashing improvements

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@565368 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2007-08-13 14:59:03 +00:00
parent c25c1282ef
commit a94db219bd
2 changed files with 5 additions and 5 deletions

View File

@ -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;

View File

@ -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;