Browse Source

Eliminate an impossible case in replaycache_scrub_if_needed_internal()

Andrea Shepard 10 years ago
parent
commit
9b3a166b44
1 changed files with 2 additions and 13 deletions
  1. 2 13
      src/or/replaycache.c

+ 2 - 13
src/or/replaycache.c

@@ -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 */