diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:01:22 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:01:22 +0000 |
commit | 71d5a2540a98c81f5bcaeb48805e0e2881f530ef (patch) | |
tree | 5343938942df402b49ec7300a1c25a2d4ccd5821 /unittests/ADT/TinyPtrVectorTest.cpp | |
parent | 31bbf64f3a4974a2d6c8b3b27ad2f519caf74057 (diff) |
Diffstat (limited to 'unittests/ADT/TinyPtrVectorTest.cpp')
-rw-r--r-- | unittests/ADT/TinyPtrVectorTest.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/unittests/ADT/TinyPtrVectorTest.cpp b/unittests/ADT/TinyPtrVectorTest.cpp index 26189b76394f..8d5fa4060913 100644 --- a/unittests/ADT/TinyPtrVectorTest.cpp +++ b/unittests/ADT/TinyPtrVectorTest.cpp @@ -17,19 +17,13 @@ #include "llvm/Support/type_traits.h" #include "gtest/gtest.h" #include <algorithm> +#include <random> #include <vector> using namespace llvm; namespace { -// The world's worst RNG, but it is deterministic and makes it easy to get -// *some* shuffling of elements. -static ptrdiff_t test_shuffle_rng(ptrdiff_t i) { - return (i + i * 33) % i; -} -static ptrdiff_t (*test_shuffle_rng_p)(ptrdiff_t) = &test_shuffle_rng; - template <typename VectorT> class TinyPtrVectorTest : public testing::Test { protected: @@ -46,7 +40,7 @@ protected: for (size_t i = 0, e = array_lengthof(TestValues); i != e; ++i) TestPtrs.push_back(&TestValues[i]); - std::random_shuffle(TestPtrs.begin(), TestPtrs.end(), test_shuffle_rng_p); + std::shuffle(TestPtrs.begin(), TestPtrs.end(), std::mt19937{}); } ArrayRef<PtrT> testArray(size_t N) { |