This commit is contained in:
krahets
2023-08-13 19:36:03 +08:00
parent 059a849167
commit 971624c291
31 changed files with 1750 additions and 156 deletions

View File

@@ -896,7 +896,7 @@ index = hash(key) % capacity
let arr = [];
for (let i = 0; i < this.#buckets.length; i++) {
if (this.#buckets[i]) {
arr.push(this.#buckets[i]?.key);
arr.push(this.#buckets[i].key);
}
}
return arr;
@@ -907,7 +907,7 @@ index = hash(key) % capacity
let arr = [];
for (let i = 0; i < this.#buckets.length; i++) {
if (this.#buckets[i]) {
arr.push(this.#buckets[i]?.val);
arr.push(this.#buckets[i].val);
}
}
return arr;
@@ -989,7 +989,7 @@ index = hash(key) % capacity
let arr: (number | undefined)[] = [];
for (let i = 0; i < this.buckets.length; i++) {
if (this.buckets[i]) {
arr.push(this.buckets[i]?.key);
arr.push(this.buckets[i].key);
}
}
return arr;
@@ -1000,7 +1000,7 @@ index = hash(key) % capacity
let arr: (string | undefined)[] = [];
for (let i = 0; i < this.buckets.length; i++) {
if (this.buckets[i]) {
arr.push(this.buckets[i]?.val);
arr.push(this.buckets[i].val);
}
}
return arr;