Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
ddc87eef
"src/localtime.c" did not exist on "e2641e09cc0daf44f63f654230f72d22acf3a9af"
Commit
ddc87eef
authored
Aug 01, 2018
by
antirez
Browse files
Explain what's the point of zslUpdateScore() in top comment.
parent
741f29ea
Changes
1
Show whitespace changes
Inline
Side-by-side
src/t_zset.c
View file @
ddc87eef
...
...
@@ -249,6 +249,11 @@ int zslDelete(zskiplist *zsl, double score, sds ele, zskiplistNode **node) {
* This function does not update the score in the hash table side, the
* caller should take care of it.
*
* Note that this function attempts to just update the node, in case after
* the score update, the node would be exactly at the same position.
* Otherwise the skiplist is modified by removing and re-adding a new
* element, which is more costly.
*
* The function returns the updated element skiplist node pointer. */
zskiplistNode *zslUpdateScore(zskiplist *zsl, double curscore, sds ele, double newscore) {
zskiplistNode *update[ZSKIPLIST_MAXLEVEL], *x;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment