revalidator: Fix ukey stats cache updating.
[sliver-openvswitch.git] / lib / hmap.c
index a559a77..542d8b5 100644 (file)
@@ -114,7 +114,7 @@ resize(struct hmap *hmap, size_t new_mask, const char *where)
         if (count > 5) {
             static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(10, 10);
             COVERAGE_INC(hmap_pathological);
-            VLOG_DBG_RL(&rl, "%s: %d nodes in bucket (%zu nodes, %zu buckets)",
+            VLOG_DBG_RL(&rl, "%s: %d nodes in bucket (%"PRIuSIZE" nodes, %"PRIuSIZE" buckets)",
                         where, count, hmap->n, hmap->mask + 1);
         }
     }
@@ -214,8 +214,8 @@ hmap_random_node(const struct hmap *hmap)
     size_t n, i;
 
     /* Choose a random non-empty bucket. */
-    for (i = random_uint32(); ; i++) {
-        bucket = hmap->buckets[i & hmap->mask];
+    for (;;) {
+        bucket = hmap->buckets[random_uint32() & hmap->mask];
         if (bucket) {
             break;
         }