From 3c5d9f478d0c0b70ec3e3100a8dacbd7437bda3e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 13 Jun 2018 16:56:19 +0200 Subject: [PATCH] std::random_shuffle -> std::shuffle The former is removed in C++17. --- src/libstore/gc.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 #include #include +#include #include #include @@ -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 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);