diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2018-06-13 16:56:19 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2018-06-13 16:56:19 +0200 |
commit | 3c5d9f478d0c0b70ec3e3100a8dacbd7437bda3e (patch) | |
tree | bd61718fa7452e7c62b8ab1e1fb32b9e7440f4b8 /src | |
parent | 0629601da1d163a059fa19004256961f8ecdeb78 (diff) |
std::random_shuffle -> std::shuffle
The former is removed in C++17.
Diffstat (limited to 'src')
-rw-r--r-- | src/libstore/gc.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index 233a70bd2..b5020a506 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -7,6 +7,7 @@ #include <queue> #include <algorithm> #include <regex> +#include <random> #include <sys/types.h> #include <sys/stat.h> @@ -832,7 +833,8 @@ void LocalStore::collectGarbage(const GCOptions & options, GCResults & results) alphabetically first (e.g. /nix/store/000...). This matters when using --max-freed etc. */ vector<Path> entries_(entries.begin(), entries.end()); - random_shuffle(entries_.begin(), entries_.end()); + std::mt19937 gen(1); + std::shuffle(entries_.begin(), entries_.end(), gen); for (auto & i : entries_) tryToDelete(state, i); |