various bugfixes

This commit is contained in:
Joel Dice
2007-08-13 18:37:00 -06:00
parent 89609e11c9
commit ab3ca38580
9 changed files with 120 additions and 53 deletions

View File

@ -52,7 +52,7 @@ public class HashMap<K, V> implements Map<K, V> {
Cell<K, V> next;
for (Cell<K, V> c = array[i]; c != null; c = next) {
next = c.next();
int index = c.getKey().hashCode() & (capacity - 1);
int index = c.hashCode() & (capacity - 1);
c.setNext(array[index]);
array[index] = c;
}