diff --git a/util/transaction_test_util.cc b/util/transaction_test_util.cc index 633391891..58d95b2ae 100644 --- a/util/transaction_test_util.cc +++ b/util/transaction_test_util.cc @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -135,8 +136,7 @@ bool RandomTransactionInserter::DoInsert(DB* db, Transaction* txn, std::vector set_vec(num_sets_); std::iota(set_vec.begin(), set_vec.end(), static_cast(0)); - std::random_shuffle(set_vec.begin(), set_vec.end(), - [&](uint64_t r) { return rand_->Uniform(r); }); + std::shuffle(set_vec.begin(), set_vec.end(), std::random_device{}); // For each set, pick a key at random and increment it for (uint16_t set_i : set_vec) { @@ -258,10 +258,8 @@ Status RandomTransactionInserter::Verify(DB* db, uint16_t num_sets, std::vector set_vec(num_sets); std::iota(set_vec.begin(), set_vec.end(), static_cast(0)); - if (rand) { - std::random_shuffle(set_vec.begin(), set_vec.end(), - [&](uint64_t r) { return rand->Uniform(r); }); - } + std::shuffle(set_vec.begin(), set_vec.end(), std::random_device{}); + // For each set of keys with the same prefix, sum all the values for (uint16_t set_i : set_vec) { // Five digits (since the largest uint16_t is 65535) plus the NUL