diff options
author | perryitay <85821686+perryitay@users.noreply.github.com> | 2021-11-03 14:12:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-03 14:12:33 +0200 |
commit | 77d3c6bff30331fb94a8570adc29872368e15ca2 (patch) | |
tree | 3d75a24a94d09bc47041c5afdbc794cb62be04b0 /src/bitops.c | |
parent | d25dc089325c7aafff84f2b2b6a263714a38e145 (diff) | |
download | redis-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.c | 2 |
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++; |