Skip to content

Commit c8d2d8d

Browse files
committed
修正 intsetMoveTail 函数的注释错误,感谢 SSS 的提醒:
http://www.redisbook.com/en/latest/compress-datastruct/intset.html#comment-905626278
1 parent 1b7fcde commit c8d2d8d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/intset.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,13 @@ static intset *intsetUpgradeAndAdd(intset *is, int64_t value) {
246246
/*
247247
* 对从 from 开始,到 is 末尾的所有数据进行移动,以 to 为起点
248248
*
249-
* 假设 3 为 from , 2 为 to ,
249+
* 假设索引 2 为 from , 索引 1 为 to ,
250250
* 之前:
251-
* | 1 | 2 | 3 | 4 |
251+
* 索引 | 0 | 1 | 2 | 3 |
252+
* 值 | a | b | c | d |
252253
* 之后:
253-
* | 1 | 3 | 4 | 4 |
254+
* 索引 | 0 | 1 | 2 | 3 |
255+
* 值 | a | c | d | d |
254256
*
255257
* T = theta(n)
256258
*/

0 commit comments

Comments
 (0)