* Move almost all uses of StringBuffer to StringBuilder,
for efficiency (thanks Arsene for the suggestion)
This commit is contained in:
@ -107,25 +107,25 @@ public class GarlicClove extends DataStructureImpl {
|
||||
|
||||
|
||||
public void writeBytes(OutputStream out) throws DataFormatException, IOException {
|
||||
StringBuffer error = null;
|
||||
StringBuilder error = null;
|
||||
if (_instructions == null) {
|
||||
if (error == null) error = new StringBuffer();
|
||||
if (error == null) error = new StringBuilder();
|
||||
error.append("No instructions ");
|
||||
}
|
||||
if (_msg == null) {
|
||||
if (error == null) error = new StringBuffer();
|
||||
if (error == null) error = new StringBuilder();
|
||||
error.append("No message ");
|
||||
}
|
||||
if (_cloveId < 0) {
|
||||
if (error == null) error = new StringBuffer();
|
||||
if (error == null) error = new StringBuilder();
|
||||
error.append("CloveID < 0 [").append(_cloveId).append("] ");
|
||||
}
|
||||
if (_expiration == null) {
|
||||
if (error == null) error = new StringBuffer();
|
||||
if (error == null) error = new StringBuilder();
|
||||
error.append("Expiration is null ");
|
||||
}
|
||||
if (_certificate == null) {
|
||||
if (error == null) error = new StringBuffer();
|
||||
if (error == null) error = new StringBuilder();
|
||||
error.append("Certificate is null ");
|
||||
}
|
||||
|
||||
@ -210,7 +210,7 @@ public class GarlicClove extends DataStructureImpl {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuffer buf = new StringBuffer(128);
|
||||
StringBuilder buf = new StringBuilder(128);
|
||||
buf.append("[GarlicClove: ");
|
||||
buf.append("\n\tInstructions: ").append(getInstructions());
|
||||
buf.append("\n\tCertificate: ").append(getCertificate());
|
||||
|
Reference in New Issue
Block a user