Merge pull request #7402 from chenhui0212/unstable
Fix comments in listpack.c
This commit is contained in:
commit
5e46e0800b
@ -773,13 +773,13 @@ unsigned char *lpSeek(unsigned char *lp, long index) {
|
|||||||
* is past the half of the listpack. */
|
* is past the half of the listpack. */
|
||||||
if (index > numele/2) {
|
if (index > numele/2) {
|
||||||
forward = 0;
|
forward = 0;
|
||||||
/* Left to right scanning always expects a negative index. Convert
|
/* Right to left scanning always expects a negative index. Convert
|
||||||
* our index to negative form. */
|
* our index to negative form. */
|
||||||
index -= numele;
|
index -= numele;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* If the listpack length is unspecified, for negative indexes we
|
/* If the listpack length is unspecified, for negative indexes we
|
||||||
* want to always scan left-to-right. */
|
* want to always scan right-to-left. */
|
||||||
if (index < 0) forward = 0;
|
if (index < 0) forward = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -487,8 +487,8 @@ static inline size_t raxLowWalk(rax *rax, unsigned char *s, size_t len, raxNode
|
|||||||
if (h->iscompr) j = 0; /* Compressed node only child is at index 0. */
|
if (h->iscompr) j = 0; /* Compressed node only child is at index 0. */
|
||||||
memcpy(&h,children+j,sizeof(h));
|
memcpy(&h,children+j,sizeof(h));
|
||||||
parentlink = children+j;
|
parentlink = children+j;
|
||||||
j = 0; /* If the new node is compressed and we do not
|
j = 0; /* If the new node is non compressed and we do not
|
||||||
iterate again (since i == l) set the split
|
iterate again (since i == len) set the split
|
||||||
position to 0 to signal this node represents
|
position to 0 to signal this node represents
|
||||||
the searched key. */
|
the searched key. */
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user