summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b16e423)
Because of the short circuit behavior of && inverting the two sides of
the if expression avoids an hash table lookup if the non-EX variant of
SET is called.
Thanks to Weibin Yao (@yaoweibin on github) for spotting this.
if (unit == UNIT_SECONDS) milliseconds *= 1000;
}
if (unit == UNIT_SECONDS) milliseconds *= 1000;
}
- if (lookupKeyWrite(c->db,key) != NULL && nx) {
+ if (nx && lookupKeyWrite(c->db,key) != NULL) {
addReply(c,shared.czero);
return;
}
addReply(c,shared.czero);
return;
}