Switch from deprecated std::random_shuffle on std::shuffle

Bug: None
Change-Id: I70320f4c7bdd18488f0bbd9fdd6c171c4a8257bb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127896
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Oleksandr Iakovenko <iakovenko@google.com>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27218}
This commit is contained in:
Artem Titov 2019-03-21 10:37:37 +01:00 committed by Commit Bot
parent 982b576bca
commit d2a637858a

View file

@ -12,6 +12,7 @@
#include <math.h> #include <math.h>
#include <algorithm> #include <algorithm>
#include <random>
#include <vector> #include <vector>
#include "test/gtest.h" #include "test/gtest.h"
@ -24,7 +25,7 @@ SamplesStatsCounter CreateStatsFilledWithIntsFrom1ToN(int n) {
for (int i = 1; i <= n; i++) { for (int i = 1; i <= n; i++) {
data.push_back(i); data.push_back(i);
} }
std::random_shuffle(data.begin(), data.end()); std::shuffle(data.begin(), data.end(), std::mt19937(std::random_device()()));
SamplesStatsCounter stats; SamplesStatsCounter stats;
for (double v : data) { for (double v : data) {