From 84ccac0edb1ca17d91db743da3a7424232982263 Mon Sep 17 00:00:00 2001 From: Mike Cifelli Date: Thu, 13 Apr 2017 09:07:30 -0400 Subject: [PATCH] Improve interpreter performance slightly --- src/interpreter/InteractiveLispInterpreter.java | 1 - src/terminal/LispTerminal.java | 3 --- test/interpreter/LispInterpreterTest.java | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/interpreter/InteractiveLispInterpreter.java b/src/interpreter/InteractiveLispInterpreter.java index 6ec99d2..94fb537 100644 --- a/src/interpreter/InteractiveLispInterpreter.java +++ b/src/interpreter/InteractiveLispInterpreter.java @@ -18,7 +18,6 @@ public class InteractiveLispInterpreter extends LispInterpreter { @Override protected void applyFinishingTouches() { - environment.getOutput().println(); environment.getOutput().println(environment.decoratePrompt("")); environment.getOutput().flush(); } diff --git a/src/terminal/LispTerminal.java b/src/terminal/LispTerminal.java index b6dec0f..0bf5b1e 100644 --- a/src/terminal/LispTerminal.java +++ b/src/terminal/LispTerminal.java @@ -412,7 +412,6 @@ public class LispTerminal { for (int c = outputReader.read(); c != EOF; c = outputReader.read()) processOutput((char) c); - terminal.setCursorVisible(true); terminal.flush(); terminal.close(); } @@ -429,9 +428,7 @@ public class LispTerminal { } private synchronized void writeSegment() { - terminal.setCursorVisible(false); printSegmentCharacters(); - terminal.setCursorVisible(true); outputSegment = ""; redisplayInput(); terminal.flush(); diff --git a/test/interpreter/LispInterpreterTest.java b/test/interpreter/LispInterpreterTest.java index 5e99f24..bbe44be 100644 --- a/test/interpreter/LispInterpreterTest.java +++ b/test/interpreter/LispInterpreterTest.java @@ -172,7 +172,7 @@ public class LispInterpreterTest { builder.setInput(createInputStreamFromString("'pickle"), "input"); builder.build().interpret(); - assertEquals(format("{0}\n{1}\n{0}\n\n", PROMPT, "PICKLE"), outputStream.toString()); + assertEquals(format("{0}\n{1}\n{0}\n", PROMPT, "PICKLE"), outputStream.toString()); assertEquals("", errorOutputStream.toString()); }