X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fhmap.c;h=542d8b5a8eb73550df8cb2322b9eb434a6f69bc9;hb=cfc50ae514f805dcd9c14589f21158185424daf6;hp=ec1de67da32a3a053ad78fa608ef7498a2da2435;hpb=34582733d9aad82bba60f4bf986b62d58412502a;p=sliver-openvswitch.git diff --git a/lib/hmap.c b/lib/hmap.c index ec1de67da..542d8b5a8 100644 --- a/lib/hmap.c +++ b/lib/hmap.c @@ -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; }