mirror of
https://github.com/redis/redis.git
synced 2026-04-21 03:01:35 -04:00
Remove redundant calls to update refcount of shared integers (#11479)
Since they're created with makeObjectShared, then incrRefCount on them is a NOP. Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
This commit is contained in:
@@ -158,7 +158,6 @@ robj *createStringObjectFromLongLongWithOptions(long long value, int valueobj) {
|
||||
}
|
||||
|
||||
if (value >= 0 && value < OBJ_SHARED_INTEGERS && valueobj == 0) {
|
||||
incrRefCount(shared.integers[value]);
|
||||
o = shared.integers[value];
|
||||
} else {
|
||||
if (value >= LONG_MIN && value <= LONG_MAX) {
|
||||
@@ -636,7 +635,6 @@ robj *tryObjectEncoding(robj *o) {
|
||||
value < OBJ_SHARED_INTEGERS)
|
||||
{
|
||||
decrRefCount(o);
|
||||
incrRefCount(shared.integers[value]);
|
||||
return shared.integers[value];
|
||||
} else {
|
||||
if (o->encoding == OBJ_ENCODING_RAW) {
|
||||
|
||||
Reference in New Issue
Block a user