Skip to content

Commit a8fcf6a

Browse files
committed
polish
1 parent 079ab6f commit a8fcf6a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

content/post/2024-06-10-zig-hashmap-1.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
2-
title: "Zig HashMap - 1"
2+
title: "HashMap 原理介绍上篇"
33
author: Wenxuan Feng
44
date: 2024-06-10T07:57:05.138Z
55
---
66

77
> 原文地址: https://www.openmymind.net/Zigs-HashMap-Part-1/
88
9-
# 引言
9+
## 引言
1010

11-
> 这篇文章的前提是了解 [Zig 的范型实现](https://www.openmymind.net/learning_zig/generics/)
11+
> 阅读这篇文章的前提是了解 [Zig 的范型实现](https://www.openmymind.net/learning_zig/generics/)
1212
1313
如大多数哈希映射实现一样,Zig 的 `std.HashMap` 依赖于两个函数:`hash(key: K) u64``eql(key_a: K, key_b: K) bool`。其中,哈希函数接收一个键并返回一个无符号的64位整数作为哈希码。相同的关键字总是会返回相同的哈希码。然而,为了处理不同的键可能生成相同哈希码的情况(即碰撞),我们还需要 `eql` 函数来确定两个键是否相等。
1414

0 commit comments

Comments
 (0)