]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/lc: random_sequence() uses default_random_engine 47488/head
authorCasey Bodley <cbodley@redhat.com>
Sat, 6 Aug 2022 15:09:38 +0000 (11:09 -0400)
committerCasey Bodley <cbodley@redhat.com>
Sat, 6 Aug 2022 15:09:40 +0000 (11:09 -0400)
we used random_device to seed a default_random_engine, but didn't use
the engine in our call to shuffle()

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_lc.cc

index 08f705d5e8b9af55f9cd1e86f61b4d3f6e2b9785..e938a520ae4cfa4832dd431300d0124ad16f9fb3 100644 (file)
@@ -1798,7 +1798,7 @@ static inline vector<int> random_sequence(uint32_t n)
     });
   std::random_device rd;
   std::default_random_engine rng{rd()};
-  std::shuffle(v.begin(), v.end(), rd);
+  std::shuffle(v.begin(), v.end(), rng);
   return v;
 }