jonyangx commented on code in PR #2955:
URL: 
https://github.com/apache/incubator-eventmesh/pull/2955#discussion_r1084799792


##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/tcp/client/group/ClientSessionGroupMapping.java:
##########
@@ -323,14 +323,14 @@ private void handleUnackMsgsInSession(Session session) {
     private void cleanClientGroupWrapperCommon(ClientGroupWrapper 
clientGroupWrapper) throws Exception {
         log.info("GroupConsumerSessions size:{}",
                 clientGroupWrapper.getGroupConsumerSessions().size());
-        if (clientGroupWrapper.getGroupConsumerSessions().size() == 0) {
+        if (clientGroupWrapper.getGroupConsumerSessions().isEmpty()) {

Review Comment:
     HashMap source code:
     /**
        * Returns the number of key-value mappings in this map.
        *
        * @return the number of key-value mappings in this map
        */
       public int size() {
           return size;
       }
   
       /**
        * Returns <tt>true</tt> if this map contains no key-value mappings.
        *
        * @return <tt>true</tt> if this map contains no key-value mappings
        */
       public boolean isEmpty() {
           return size == 0;
       }
   
   The complexity of size()  is the same as isEmpty().
   Suggest check  the condition: clientGroupWrapper.getGroupConsumerSessions() 
is null.
   



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to