Fix the code of hash map chaining.

This commit is contained in:
krahets
2023-08-01 17:05:40 +08:00
parent 55615ab61d
commit 6da6d24193
7 changed files with 79 additions and 61 deletions
@@ -89,10 +89,10 @@ func (m *hashMapChaining) remove(key int) {
if p.key == key {
// 切片删除
m.buckets[idx] = append(m.buckets[idx][:i], m.buckets[idx][i+1:]...)
m.size -= 1
break
}
}
m.size -= 1
}
/* 扩容哈希表 */