]> git.saurik.com Git - redis.git/commit - src/t_string.c
Invert two sides of if expression in SET to avoid a lookup.
authorantirez <antirez@gmail.com>
Wed, 31 Oct 2012 08:23:05 +0000 (09:23 +0100)
committerantirez <antirez@gmail.com>
Wed, 31 Oct 2012 08:23:05 +0000 (09:23 +0100)
commit973cb21a0152642ec904cf8f8ab238a31e6ebaa9
tree1c1b3e2bf983f33e85be6bd20574196d5effb457
parentb16e423430465013c14af1550f29e7c25c3a433c
Invert two sides of if expression in SET to avoid a lookup.

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.
src/t_string.c