Skip to content

Commit

Permalink
Remove the usage of std::random_device.
Browse files Browse the repository at this point in the history
  • Loading branch information
Barenboim committed Jun 2, 2023
1 parent b233cdc commit 1b98dd0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nameservice/UpstreamPolicies.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
// for std::min on windows
#define NOMINMAX

#include <stdlib.h>
#include <mutex>
#include <random>
#include <algorithm>
Expand All @@ -31,7 +32,7 @@
class EndpointGroup
{
public:
EndpointGroup(int group_id, UPSGroupPolicy *policy) : gen(rd())
EndpointGroup(int group_id, UPSGroupPolicy *policy) : gen(std::rand())
{
this->id = group_id;
this->policy = policy;
Expand All @@ -47,7 +48,6 @@ class EndpointGroup
UPSGroupPolicy *policy;
struct rb_node rb;
std::mutex mutex;
std::random_device rd;
std::mt19937 gen;
std::vector<EndpointAddress *> mains;
std::vector<EndpointAddress *> backups;
Expand Down

0 comments on commit 1b98dd0

Please sign in to comment.