mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
replace random_shuffle with shuffle
random_shuffle is gone with C++17. Found and fixed with clang-tidy.
This commit is contained in:
parent
6cc388c1bc
commit
eabcafa516
2 changed files with 4 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
|||
#include <string.h>
|
||||
#include "I2PEndian.h"
|
||||
#include <random>
|
||||
#include <thread>
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
@ -45,7 +46,7 @@ namespace tunnel
|
|||
// shuffle records
|
||||
std::vector<int> recordIndicies;
|
||||
for (int i = 0; i < numRecords; i++) recordIndicies.push_back(i);
|
||||
std::random_shuffle (recordIndicies.begin(), recordIndicies.end());
|
||||
std::shuffle (recordIndicies.begin(), recordIndicies.end(), std::mt19937(std::random_device()()));
|
||||
|
||||
// create real records
|
||||
uint8_t * records = msg->GetPayload () + 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue