]> 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:27:48 +0000 (09:27 +0100)
commit4d9bd5353027561039dc4583c794c8cfec30202c
tree50d9c2a472deda1aa283e5715b5df94378f83a5b
parent5bf0997ff879bf8668939d6b9e8a6eb877750c09
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