You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2019/05/28 14:12:04 UTC

[GitHub] [skywalking] wu-sheng commented on a change in pull request #2776: Added minor performance improvements

wu-sheng commented on a change in pull request #2776: Added minor performance improvements
URL: https://github.com/apache/skywalking/pull/2776#discussion_r288125993
 
 

 ##########
 File path: oap-server/server-library/library-util/src/main/java/org/apache/skywalking/oap/server/library/util/CollectionUtils.java
 ##########
 @@ -26,15 +26,15 @@
 public class CollectionUtils {
 
     public static boolean isEmpty(Map map) {
-        return map == null || map.size() == 0;
+        return map == null || map.isEmpty();
 
 Review comment:
   In most list, `isEmpty` == `size() == 0`. Could you give me some benchmark to indicate this will improve performance?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services