[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-bugs] #17830 [metrics-lib]: use StringBuilder correctly
#17830: use StringBuilder correctly
-----------------------------+---------------------
Reporter: iwakeh | Owner: karsten
Type: defect | Status: new
Priority: Medium | Milestone:
Component: metrics-lib | Version:
Severity: Normal | Keywords:
Actual Points: | Parent ID: #17822
Points: | Sponsor:
-----------------------------+---------------------
This is not java 7 related, but should be included here:
Code like this
{{{
crypto = new StringBuilder();
crypto.append(line + "\n");
}}}
defeats the purpose of using StringBuilder, because String concatenation
using {{{+}}} will internally be accomplished by using another
StringBuilder (see Javadoc).
This should also be added to the coding guidelines (or did we write these
for Onionoo only?).
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/17830>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs