Permalink
Browse files

Comment improved so that the code goal is more clear. Thx to @agladysh.

  • Loading branch information...
1 parent 1dcc95d commit f333788fbcaf67fa97c509f0f61d557b6669b1fe @antirez committed May 11, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/redis.c
View
@@ -658,7 +658,7 @@ void activeExpireCycle(void) {
* expire. So after a given amount of milliseconds return to the
* caller waiting for the other active expire cycle. */
iteration++;
- if ((iteration & 0xff) == 0 && /* & 0xff is the same as % 255 */
+ if ((iteration & 0xff) == 0 && /* Check once every 255 iterations */
(mstime()-start) > REDIS_EXPIRELOOKUPS_TIME_LIMIT) return;
} while (expired > REDIS_EXPIRELOOKUPS_PER_CRON/4);
}

3 comments on commit f333788

@kosma
kosma commented on f333788 May 14, 2012

Shouldn't this be "once every 256 iterations"?

@anfernee

+1 for 256. actually i think the original comment is better...

@antirez
Owner

sure, 256, 255 is the mask :) Sorry for the typo. Anyway now this code changed in latest unstable so it is fine. Thanks.

Please sign in to comment.