BaseHashMap.java (hsqldb-2.6.0) | : | BaseHashMap.java (hsqldb-2.6.1) | ||
---|---|---|---|---|
skipping to change at line 241 | skipping to change at line 241 | |||
if (comparator.equals(key, current)) { | if (comparator.equals(key, current)) { | |||
break; | break; | |||
} | } | |||
} | } | |||
return lookup; | return lookup; | |||
} | } | |||
protected int getLookup(int key) { | protected int getLookup(int key) { | |||
int lookup = hashIndex.getLookup(key); | int hash = (int) ((long) key >>> 32 ^ key); | |||
int lookup = hashIndex.getLookup(hash); | ||||
for (; lookup >= 0; lookup = hashIndex.getNextLookup(lookup)) { | for (; lookup >= 0; lookup = hashIndex.getNextLookup(lookup)) { | |||
int current = intKeyTable[lookup]; | int current = intKeyTable[lookup]; | |||
if (key == current) { | if (key == current) { | |||
break; | break; | |||
} | } | |||
} | } | |||
return lookup; | return lookup; | |||
skipping to change at line 1014 | skipping to change at line 1015 | |||
int limitLookup = hashIndex.newNodePointer; | int limitLookup = hashIndex.newNodePointer; | |||
boolean oldZeroKey = hasZeroKey; | boolean oldZeroKey = hasZeroKey; | |||
int oldZeroKeyIndex = zeroKeyIndex; | int oldZeroKeyIndex = zeroKeyIndex; | |||
if (newCapacity < hashIndex.elementCount) { | if (newCapacity < hashIndex.elementCount) { | |||
return; | return; | |||
} | } | |||
hashIndex.reset((int) (newCapacity * loadFactor), newCapacity); | hashIndex.reset((int) (newCapacity * loadFactor), newCapacity); | |||
hasZeroKey = false; | hasZeroKey = false; | |||
zeroKeyIndex = -1; | zeroKeyIndex = -1; | |||
zeroOrNullValueCount = 0; | ||||
threshold = newCapacity; | threshold = newCapacity; | |||
for (int lookup = -1; | for (int lookup = -1; | |||
(lookup = nextLookup(lookup, limitLookup, oldZeroKey, oldZeroKey Index)) | (lookup = nextLookup(lookup, limitLookup, oldZeroKey, oldZeroKey Index)) | |||
< limitLookup; ) { | < limitLookup; ) { | |||
long longKey = 0; | long longKey = 0; | |||
long longValue = 0; | long longValue = 0; | |||
Object objectKey = null; | Object objectKey = null; | |||
Object objectValue = null; | Object objectValue = null; | |||
skipping to change at line 1398 | skipping to change at line 1400 | |||
/** | /** | |||
* Clear the map completely. | * Clear the map completely. | |||
*/ | */ | |||
public void clear() { | public void clear() { | |||
if (hashIndex.modified) { | if (hashIndex.modified) { | |||
if (accessCount != null) { | if (accessCount != null) { | |||
accessCount.set(0); | accessCount.set(0); | |||
} | } | |||
accessMin = 0; | accessMin = 0; | |||
hasZeroKey = false; | hasZeroKey = false; | |||
zeroKeyIndex = -1; | zeroKeyIndex = -1; | |||
zeroOrNullValueCount = 0; | ||||
clearElementArrays(0, hashIndex.newNodePointer); | clearElementArrays(0, hashIndex.newNodePointer); | |||
hashIndex.clear(); | hashIndex.clear(); | |||
if (minimizeOnEmpty) { | if (minimizeOnEmpty) { | |||
rehash(initialCapacity); | rehash(initialCapacity); | |||
} | } | |||
} | } | |||
} | } | |||
End of changes. 3 change blocks. | ||||
6 lines changed or deleted | 9 lines changed or added |