zyx333 opened a new issue, #6398:
URL: https://github.com/apache/rocketmq/issues/6398

   The code block below in the selectOneMessageQueue method is identical to 
another overloaded method (2nd code block).
   
   
https://github.com/apache/rocketmq/blob/7d6748445617dea43bc8c2c0410292e2eb423dc1/client/src/main/java/org/apache/rocketmq/client/impl/producer/TopicPublishInfo.java#L74-L76
   
   
https://github.com/apache/rocketmq/blob/7d6748445617dea43bc8c2c0410292e2eb423dc1/client/src/main/java/org/apache/rocketmq/client/impl/producer/TopicPublishInfo.java#L85-L90
   
   IMO, it can be rewritten like this.
   ```
   for (int i = 0; i < this.messageQueueList.size(); i++) {
            MessageQueue mq = selectOneMessageQueue()
            if (!mq.getBrokerName().equals(lastBrokerName)) {
                  return mq;
            }
    }
   ```
   
   If it's acceptable, I will submit a pull request.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to