Skip to content

Conversation

leonyzhe
Copy link
Contributor

@leonyzhe leonyzhe commented Dec 10, 2017

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a JIRA issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [JAV-XXX] Fixes bug in ApproximateQuantiles, where you replace JAV-XXX with the appropriate JIRA issue.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean install to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

fix #391

@leonyzhe leonyzhe changed the title Use StringBuffer instead of String in loops for concatenation Use StringBuilder instead of String in loops for concatenation Dec 10, 2017
@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.865% when pulling 8f77917 on yz19910419:leon into 94f2c73 on ServiceComb:master.

this.pathParamWriterList.add(new StaticUrlParamWriter(tmpPath));
tmpPath = "";
this.pathParamWriterList.add(new StaticUrlParamWriter(tmpPath.toString()));
tmpPath = tmpPath.delete(0, tmpPath.length());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tmpPath.setLength(0) is simpler.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @wujimin , that's a brilliant idea.

@wujimin
Copy link
Contributor

wujimin commented Dec 10, 2017

the optimization is OK, but not absolutely necessary, :)
because only invoked during boot, not performance bottlenecks.

@leonyzhe leonyzhe closed this Dec 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better use StringBuffer append instead of String concatenation in loops.
3 participants