mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-21 19:06:11 +00:00
Many bug fixes and improvements (#1270)
* Add Ruby and Kotlin icons Add the avatar of @curtishd * Update README * Synchronize zh-hant and zh versions. * Translate the pythontutor blocks to traditional Chinese * Fix en/mkdocs.yml * Update the landing page of the en version. * Fix the Dockerfile * Refine the en landingpage * Fix en landing page * Reset the README.md
This commit is contained in:
@@ -102,17 +102,14 @@ impl HashMapChaining {
|
||||
// 走訪桶,若遇到指定 key ,則更新對應 val 並返回
|
||||
for pair in bucket {
|
||||
if pair.key == key {
|
||||
pair.val = val.clone();
|
||||
pair.val = val;
|
||||
return;
|
||||
}
|
||||
}
|
||||
let bucket = &mut self.buckets[index];
|
||||
|
||||
// 若無該 key ,則將鍵值對新增至尾部
|
||||
let pair = Pair {
|
||||
key,
|
||||
val: val.clone(),
|
||||
};
|
||||
let pair = Pair { key, val };
|
||||
bucket.push(pair);
|
||||
self.size += 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user