mirror of
http://github.com/valkey-io/valkey
synced 2024-11-23 20:00:00 +00:00
PFCOUNT: unshare the object when cached cardinality is modified.
This commit is contained in:
parent
be9860d0e9
commit
9682295f68
@ -541,6 +541,9 @@ void pfcountCommand(redisClient *c) {
|
||||
card |= (uint64_t)registers[REDIS_HLL_SIZE-9] << 56;
|
||||
} else {
|
||||
/* Recompute it and update the cached value. */
|
||||
o = dbUnshareStringValue(c->db,c->argv[1],o);
|
||||
registers = o->ptr;
|
||||
|
||||
card = hllCount(registers);
|
||||
registers[REDIS_HLL_SIZE-16] = card & 0xff;
|
||||
registers[REDIS_HLL_SIZE-15] = (card >> 8) & 0xff;
|
||||
|
Loading…
Reference in New Issue
Block a user