You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@servicecomb.apache.org by "Ang Li (Jira)" <ji...@apache.org> on 2019/10/17 07:16:00 UTC
[jira] [Commented] (SCB-1528) Optimizing some code implementations
[ https://issues.apache.org/jira/browse/SCB-1528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16953463#comment-16953463 ]
Ang Li commented on SCB-1528:
-----------------------------
# Iterating entrySet() is more efficent than entryKey() when call map.get(key) each time;
# Collections.isEmpty() is more efficent than collections.size() == 0
# Util classes should have private constructures
# String.valueOf() is more efficent then + ""
# BigDecimal() may cause some precision problems while BigDecimal.valueOf() not
# Return empty collection instead of null can prevent NPE
# Objects.equals(a, b) is better than a.equals(b) because of NPE
# Data in enum shoud be private final
> Optimizing some code implementations
> ------------------------------------
>
> Key: SCB-1528
> URL: https://issues.apache.org/jira/browse/SCB-1528
> Project: Apache ServiceComb
> Issue Type: Improvement
> Components: Java-Chassis
> Reporter: Ang Li
> Assignee: Ang Li
> Priority: Trivial
> Time Spent: 20m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)