Technoboy- commented on code in PR #24634:
URL: https://github.com/apache/pulsar/pull/24634#discussion_r2281189630


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumersClassic.java:
##########
@@ -166,27 +182,32 @@ public synchronized CompletableFuture<Void> 
addConsumer(Consumer consumer) {
         });
     }
 
+    /**
+     * Sort items in the collection "recentlyJoinedConsumers" if needed.
+     * Since we check the order of queue after each consumer joined, we can 
only check the last two items.
+     */
     private void sortRecentlyJoinedConsumersIfNeeded() {
         if (!sortRecentlyJoinedConsumersIfNeeded) {
             return;
         }
         if (recentlyJoinedConsumers.size() == 1) {
             return;
         }
-        // Since we check the order of queue after each consumer joined, we 
can only check the last two items.
         boolean sortNeeded = false;
-        Position posPre = null;
-        Position posAfter = null;
+        Position secondLatest = null;

Review Comment:
   Seems the old name is much more better.



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