Remove unnecessary memory allocations

This commit is contained in:
Peter Osterlund 2019-05-23 21:03:23 +02:00
parent f534754f10
commit dfaa220946

View File

@ -117,7 +117,7 @@ public class PortListener {
inQuote = !inQuote; inQuote = !inQuote;
if (!inQuote) { if (!inQuote) {
cmdList.add(sb.toString()); cmdList.add(sb.toString());
sb = new StringBuilder(); sb.setLength(0);
} }
break; break;
case '\\': case '\\':
@ -131,7 +131,7 @@ public class PortListener {
if (!inQuote) { if (!inQuote) {
if (!sb.toString().isEmpty()) { if (!sb.toString().isEmpty()) {
cmdList.add(sb.toString()); cmdList.add(sb.toString());
sb = new StringBuilder(); sb.setLength(0);
} }
break; break;
} }