Skip to content

Commit c18be2d

Browse files
committed
Fixed bug in ProbingHashMap - clear() method was not clearing array elements in loop, missing square braces
1 parent a159900 commit c18be2d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/com/jwetherell/algorithms/data_structures/HashMap.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ public V remove(K key) {
514514
@Override
515515
public void clear() {
516516
for (int i=0; i<array.length; i++)
517-
array = null;
517+
array[i] = null;
518518
size = 0;
519519
}
520520

0 commit comments

Comments
 (0)