From 1b98dd07047072fb3a5a79d04177c65abc720ae1 Mon Sep 17 00:00:00 2001 From: Xie Han <63350856@qq.com> Date: Fri, 2 Jun 2023 21:33:52 +0800 Subject: [PATCH] Remove the usage of std::random_device. --- src/nameservice/UpstreamPolicies.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nameservice/UpstreamPolicies.cc b/src/nameservice/UpstreamPolicies.cc index 5e08b62354..2e8cf6dac2 100644 --- a/src/nameservice/UpstreamPolicies.cc +++ b/src/nameservice/UpstreamPolicies.cc @@ -20,6 +20,7 @@ // for std::min on windows #define NOMINMAX +#include #include #include #include @@ -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; @@ -47,7 +48,6 @@ class EndpointGroup UPSGroupPolicy *policy; struct rb_node rb; std::mutex mutex; - std::random_device rd; std::mt19937 gen; std::vector mains; std::vector backups;