summaryrefslogtreecommitdiff
path: root/src/bitops.c
diff options
context:
space:
mode:
authorperryitay <85821686+perryitay@users.noreply.github.com>2021-11-03 14:12:33 +0200
committerGitHub <noreply@github.com>2021-11-03 14:12:33 +0200
commit77d3c6bff30331fb94a8570adc29872368e15ca2 (patch)
tree3d75a24a94d09bc47041c5afdbc794cb62be04b0 /src/bitops.c
parentd25dc089325c7aafff84f2b2b6a263714a38e145 (diff)
downloadredis-77d3c6bff30331fb94a8570adc29872368e15ca2.tar.gz
fix: lookupKey on SETNX and SETXX only once (#9640)
When using SETNX and SETXX we could end up doing key lookup twice. This presents a small inefficiency price. Also once we have statistics of write hit and miss they'll be wrong (recording the same key hit twice)
Diffstat (limited to 'src/bitops.c')
-rw-r--r--src/bitops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bitops.c b/src/bitops.c
index 5190e1035..f69e6b4c6 100644
--- a/src/bitops.c
+++ b/src/bitops.c
@@ -777,7 +777,7 @@ void bitopCommand(client *c) {
/* Store the computed value into the target key */
if (maxlen) {
o = createObject(OBJ_STRING,res);
- setKey(c,c->db,targetkey,o);
+ setKey(c,c->db,targetkey,o,0);
notifyKeyspaceEvent(NOTIFY_STRING,"set",targetkey,c->db->id);
decrRefCount(o);
server.dirty++;