From dfaa2209460f68f3a68f240ef681ae9dfb939a47 Mon Sep 17 00:00:00 2001 From: Peter Osterlund Date: Thu, 23 May 2019 21:03:23 +0200 Subject: [PATCH] Remove unnecessary memory allocations --- .../src/main/java/org/petero/engineserver/PortListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EngineServer/src/main/java/org/petero/engineserver/PortListener.java b/EngineServer/src/main/java/org/petero/engineserver/PortListener.java index fb474de..abb17d8 100644 --- a/EngineServer/src/main/java/org/petero/engineserver/PortListener.java +++ b/EngineServer/src/main/java/org/petero/engineserver/PortListener.java @@ -117,7 +117,7 @@ public class PortListener { inQuote = !inQuote; if (!inQuote) { cmdList.add(sb.toString()); - sb = new StringBuilder(); + sb.setLength(0); } break; case '\\': @@ -131,7 +131,7 @@ public class PortListener { if (!inQuote) { if (!sb.toString().isEmpty()) { cmdList.add(sb.toString()); - sb = new StringBuilder(); + sb.setLength(0); } break; }