質問編集履歴

1

includesKey の for の中を多少修正しました

2018/08/04 23:55

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -166,11 +166,7 @@
166
166
 
167
167
  public boolean includesKey(K key) {
168
168
 
169
- int h = key.hashCode();
170
-
171
- int b = Math.abs(h % this.entries.length);
172
-
173
- for (HashTableEntry<K, V> e : bucket(b))
169
+ for (HashTableEntry<K, V> e : bucket(this.entries.length))
174
170
 
175
171
  if (key.equals(e.getKey()))
176
172