AngLi2 commented on issue #1353: [SCB-1528] Optimizing some code implementations
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1353#issuecomment-542603909
 
 
   1. Iterating entrySet() is more efficent than entryKey() when call 
map.get(key) each time;
   2. Collections.isEmpty() is more efficent than collections.size() == 0
   3. Util classes should have private constructures
   4. String.valueOf() is more efficent then + ""
   5. BigDecimal() may cause some precision problems while BigDecimal.valueOf() 
not
   6. Return empty collection instead of null can prevent NPE
   7. Objects.equals(a, b) is better than a.equals(b) because of NPE
   8. Data in enum shoud be private final

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to