Changeset 12971
- Timestamp:
- 10/10/10 15:48:48 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/HashTable.java
r12970 r12971 250 250 protected HashEntry getEntry(LispObject key) { 251 251 HashEntry[] b = buckets; 252 HashEntry e = b[comparator.hash(key) & (b.length - 1)]; 252 int hash = comparator.hash(key); 253 HashEntry e = b[hash & (b.length - 1)]; 253 254 while (e != null) { 254 if (comparator.keysEqual(key, e.key)) { 255 if (hash == e.hash && 256 (key == e.key || comparator.keysEqual(key, e.key))) { 255 257 return e; 256 258 } … … 288 290 } 289 291 290 int index = comparator.hash(key) & (buckets.length - 1); 291 buckets[index] = new HashEntry(key, value, buckets[index]); 292 int hash = comparator.hash(key); 293 int index = hash & (buckets.length - 1); 294 buckets[index] = new HashEntry(key, hash, value, buckets[index]); 292 295 } 293 296 } finally { … … 334 337 while (e != null) { 335 338 final int index = comparator.hash(e.key) & mask; 336 newBuckets[index] = new HashEntry(e.key, e.value, newBuckets[index]); 339 newBuckets[index] = new HashEntry(e.key, e.hash, e.value, 340 newBuckets[index]); 337 341 e = e.next; 338 342 } … … 437 441 438 442 LispObject key; 443 int hash; 439 444 volatile LispObject value; 440 445 HashEntry next; 441 446 442 HashEntry(LispObject key, LispObject value, HashEntry next) {447 HashEntry(LispObject key, int hash, LispObject value, HashEntry next) { 443 448 this.key = key; 449 this.hash = hash; 444 450 this.value = value; 445 451 this.next = next;
Note: See TracChangeset
for help on using the changeset viewer.