the use of `std::random_shuffle()` was introduced by
b946308 .
in this change, it is replaced using `std::shuffle()`.
Fixes: https://tracker.ceph.com/issues/43084
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit
30dfef208d859a67c1f1b13c314735861c536e85)
vector<int> rules;
for (auto& r: pools_by_rule)
rules.push_back(r.first);
- srand(time(0));
- random_shuffle (rules.begin(), rules.end());
+ std::random_device rd;
+ std::shuffle(rules.begin(), rules.end(), std::mt19937{rd()});
if (debug) {
for (auto& r: rules)
cout << "rule: " << r << " " << pools_by_rule[r] << std::endl;