Eliminate an impossible case in replaycache_scrub_if_needed_internal()

This commit is contained in:
Andrea Shepard 2013-07-16 06:01:50 -07:00
parent d1059a9366
commit 9b3a166b44

View File

@ -134,7 +134,6 @@ replaycache_scrub_if_needed_internal(time_t present, replaycache_t *r)
const char *digest;
void *valp;
time_t *access_time;
char scrub_this;
/* sanity check */
if (!r || !(r->digests_seen)) {
@ -152,20 +151,10 @@ replaycache_scrub_if_needed_internal(time_t present, replaycache_t *r)
/* okay, scrub time */
itr = digestmap_iter_init(r->digests_seen);
while (!digestmap_iter_done(itr)) {
scrub_this = 0;
digestmap_iter_get(itr, &digest, &valp);
access_time = (time_t *)valp;
if (access_time) {
/* aged out yet? */
if (*access_time < present - r->horizon) scrub_this = 1;
} else {
/* Buh? Get rid of it, anyway */
log_info(LD_BUG, "replaycache_scrub_if_needed_internal() saw a NULL"
" entry in the digestmap.");
scrub_this = 1;
}
if (scrub_this) {
/* aged out yet? */
if (*access_time < present - r->horizon) {
/* Advance the iterator and remove this one */
itr = digestmap_iter_next_rmv(r->digests_seen, itr);
/* Free the value removed */