Skip to content

Commit bea2b80

Browse files
committed
Merge pull request huangzworks#11 from garyelephant/unstable
added some comments and fixed typos
2 parents ffc4836 + e159940 commit bea2b80

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/dict.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ typedef struct dictEntry {
7171
* 特定于类型的一簇处理函数
7272
*/
7373
typedef struct dictType {
74-
// 计算键的哈希值函数
74+
// 计算键的哈希值函数, 计算key在hash table中的存储位置,不同的dict可以有不同的hash function.
7575
unsigned int (*hashFunction)(const void *key);
7676
// 复制键的函数
7777
void *(*keyDup)(void *privdata, const void *key);

src/sds.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ struct sdshdr {
4949
int free;
5050

5151
// 实际保存字符串数据的地方
52+
// 利用c99(C99 specification 6.7.2.1.16)中引入的 flexible array member,通过buf来引用sdshdr后面的地址,
53+
// 详情google "flexible array member"
5254
char buf[];
5355
};
5456

src/util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ int ll2string(char *s, size_t len, long long value) {
239239
}
240240

241241
/*
242-
* 将一个字符串转换为 long logn 整数值
242+
* 将一个字符串转换为 long long 整数值
243243
*
244244
* 复杂度:O(N)
245245
*

0 commit comments

Comments
 (0)