Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc8d2d8d

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

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)

[8]ページ先頭

©2009-2025 Movatter.jp