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:
Hanif Ariffin
2022-11-06 14:33:28 +08:00
committed by GitHub
parent 5246bf4544
commit 0cbe10e892

View File

@@ -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) {