We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ea7853e commit 3cc813dCopy full SHA for 3cc813d
src/_DataStructures_/HashTable/index.js
@@ -11,15 +11,15 @@ class HashTable {
11
this.threshold = 0.7;
12
// the main bucket
13
this.bucket = new Array(this.slot);
14
+ // fill the bucket with null
15
+ // for (let i = 0; i < this.slot; i += 1) this.bucket[i] = null;
16
+ this.bucket.fill(null);
17
this.allowResize = allowResize;
18
this.strongHash = strongHash;
19
if (custonHash) {
20
// eslint-disable-next-line no-underscore-dangle
21
this._hash = custonHash;
22
}
-
- // fill the bucket with null
- for (let i = 0; i < this.slot; i += 1) this.bucket[i] = null;
23
24
25
_hash(key) {
0 commit comments