oxsean commented on code in PR #13607:
URL: https://github.com/apache/dubbo/pull/13607#discussion_r1457009393


##########
dubbo-common/src/main/java/org/apache/dubbo/common/utils/CollectionUtils.java:
##########
@@ -404,13 +405,19 @@ public static <T> T first(Collection<T> values) {
             return null;
         }
         if (values instanceof List) {
-            List<T> list = (List<T>) values;
-            return list.get(0);
+            return ((List<T>) values).get(0);
         } else {
             return values.iterator().next();
         }
     }
 
+    public static <T> T first(List<T> values) {

Review Comment:
   It will eliminate one class type check and as an overloaded method, it has 
no significant usage cost.



-- 
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: notifications-unsubscr...@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org
For additional commands, e-mail: notifications-h...@dubbo.apache.org

Reply via email to