Unverified Commit 0cbe10e8 authored by Hanif Ariffin's avatar Hanif Ariffin Committed by GitHub
Browse files

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: default avatarHanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
parent 5246bf45
...@@ -158,7 +158,6 @@ robj *createStringObjectFromLongLongWithOptions(long long value, int valueobj) { ...@@ -158,7 +158,6 @@ robj *createStringObjectFromLongLongWithOptions(long long value, int valueobj) {
} }
if (value >= 0 && value < OBJ_SHARED_INTEGERS && valueobj == 0) { if (value >= 0 && value < OBJ_SHARED_INTEGERS && valueobj == 0) {
incrRefCount(shared.integers[value]);
o = shared.integers[value]; o = shared.integers[value];
} else { } else {
if (value >= LONG_MIN && value <= LONG_MAX) { if (value >= LONG_MIN && value <= LONG_MAX) {
...@@ -636,7 +635,6 @@ robj *tryObjectEncoding(robj *o) { ...@@ -636,7 +635,6 @@ robj *tryObjectEncoding(robj *o) {
value < OBJ_SHARED_INTEGERS) value < OBJ_SHARED_INTEGERS)
{ {
decrRefCount(o); decrRefCount(o);
incrRefCount(shared.integers[value]);
return shared.integers[value]; return shared.integers[value];
} else { } else {
if (o->encoding == OBJ_ENCODING_RAW) { if (o->encoding == OBJ_ENCODING_RAW) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment