Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
cd7a4971
Commit
cd7a4971
authored
May 31, 2011
by
antirez
Browse files
revert ZADD implementation to 2.4 WATCH API.
parent
5fca35da
Changes
1
Show whitespace changes
Inline
Side-by-side
src/t_zset.c
View file @
cd7a4971
...
@@ -882,7 +882,7 @@ void zaddGenericCommand(redisClient *c, int incr) {
...
@@ -882,7 +882,7 @@ void zaddGenericCommand(redisClient *c, int incr) {
zobj
->
ptr
=
zzlDelete
(
zobj
->
ptr
,
eptr
);
zobj
->
ptr
=
zzlDelete
(
zobj
->
ptr
,
eptr
);
zobj
->
ptr
=
zzlInsert
(
zobj
->
ptr
,
ele
,
score
);
zobj
->
ptr
=
zzlInsert
(
zobj
->
ptr
,
ele
,
score
);
signalModifi
edKey
(
c
->
db
,
key
);
touchWatch
edKey
(
c
->
db
,
key
);
server
.
dirty
++
;
server
.
dirty
++
;
}
}
}
else
{
}
else
{
...
@@ -894,7 +894,7 @@ void zaddGenericCommand(redisClient *c, int incr) {
...
@@ -894,7 +894,7 @@ void zaddGenericCommand(redisClient *c, int incr) {
if
(
sdslen
(
ele
->
ptr
)
>
server
.
zset_max_ziplist_value
)
if
(
sdslen
(
ele
->
ptr
)
>
server
.
zset_max_ziplist_value
)
zsetConvert
(
zobj
,
REDIS_ENCODING_SKIPLIST
);
zsetConvert
(
zobj
,
REDIS_ENCODING_SKIPLIST
);
signalModifi
edKey
(
c
->
db
,
key
);
touchWatch
edKey
(
c
->
db
,
key
);
server
.
dirty
++
;
server
.
dirty
++
;
if
(
!
incr
)
added
++
;
if
(
!
incr
)
added
++
;
}
}
...
@@ -929,7 +929,7 @@ void zaddGenericCommand(redisClient *c, int incr) {
...
@@ -929,7 +929,7 @@ void zaddGenericCommand(redisClient *c, int incr) {
incrRefCount
(
curobj
);
/* Re-inserted in skiplist. */
incrRefCount
(
curobj
);
/* Re-inserted in skiplist. */
dictGetEntryVal
(
de
)
=
&
znode
->
score
;
/* Update score ptr. */
dictGetEntryVal
(
de
)
=
&
znode
->
score
;
/* Update score ptr. */
signalModifi
edKey
(
c
->
db
,
key
);
touchWatch
edKey
(
c
->
db
,
key
);
server
.
dirty
++
;
server
.
dirty
++
;
}
}
}
else
{
}
else
{
...
@@ -938,7 +938,7 @@ void zaddGenericCommand(redisClient *c, int incr) {
...
@@ -938,7 +938,7 @@ void zaddGenericCommand(redisClient *c, int incr) {
redisAssert
(
dictAdd
(
zs
->
dict
,
ele
,
&
znode
->
score
)
==
DICT_OK
);
redisAssert
(
dictAdd
(
zs
->
dict
,
ele
,
&
znode
->
score
)
==
DICT_OK
);
incrRefCount
(
ele
);
/* Added to dictionary. */
incrRefCount
(
ele
);
/* Added to dictionary. */
signalModifi
edKey
(
c
->
db
,
key
);
touchWatch
edKey
(
c
->
db
,
key
);
server
.
dirty
++
;
server
.
dirty
++
;
if
(
!
incr
)
added
++
;
if
(
!
incr
)
added
++
;
}
}
...
...
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