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/04/24 02:05:08 UTC

[GitHub] [rocketmq-mqtt] pingww commented on a diff in pull request #82: improving codeCov for #22

pingww commented on code in PR #82:
URL: https://github.com/apache/rocketmq-mqtt/pull/82#discussion_r857054236


##########
mqtt-cs/src/main/java/org/apache/rocketmq/mqtt/cs/session/infly/MqttMsgId.java:
##########
@@ -59,22 +59,17 @@ public int nextId(String clientId) {
         MsgIdEntry msgIdEntry = hashMsgID(clientId);
         synchronized (msgIdEntry) {
             int startingMessageId = msgIdEntry.nextMsgId;
-            int loopCount = 0;
-            int maxLoopCount = 1;
             do {
                 msgIdEntry.nextMsgId++;
                 if (msgIdEntry.nextMsgId > MAX_MSG_ID) {
                     msgIdEntry.nextMsgId = MIN_MSG_ID;
                 }
                 if (msgIdEntry.nextMsgId == startingMessageId) {
-                    loopCount++;
-                    if (loopCount >= maxLoopCount) {

Review Comment:
   Yes, it may be the case that maxLoopCount>1 was considered before



-- 
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