You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/07/01 23:32:58 UTC

[GitHub] [rocketmq-client-cpp] ifplusor commented on a diff in pull request #428: change seed, otherwise random number will not be changed

ifplusor commented on code in PR #428:
URL: https://github.com/apache/rocketmq-client-cpp/pull/428#discussion_r912288364


##########
src/protocol/TopicRouteData.h:
##########
@@ -122,11 +122,13 @@ class TopicRouteData {
   std::string selectBrokerAddr() {
     int bdSize = m_brokerDatas.size();
     if (bdSize > 0) {
+      std::srand(std::time(0) + bdSize);

Review Comment:
   Don't set seed every time.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org