From: Pieter Noordhuis Date: Mon, 30 Apr 2012 17:16:20 +0000 (-0700) Subject: Use safe dictionary iterator from KEYS X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/cc4f65fea4f72ba891b07769d685364f209f5355?hp=cc4f65fea4f72ba891b07769d685364f209f5355 Use safe dictionary iterator from KEYS Every matched key in a KEYS call is checked for expiration. When the key is set to expire, the call to `getExpire` will assert that the key also exists in the main dictionary. This in turn causes a rehashing step to be executed. Rehashing a dictionary when there is an iterator active may result in the iterator emitting duplicate entries, or not emitting some entries at all. By using a safe iterator, the rehash step is omitted. ---