Improve interpreter performance slightly

This commit is contained in:
Mike Cifelli 2017-04-13 09:07:30 -04:00
parent cbbcb4fe3e
commit 84ccac0edb
3 changed files with 1 additions and 5 deletions

View File

@ -18,7 +18,6 @@ public class InteractiveLispInterpreter extends LispInterpreter {
@Override
protected void applyFinishingTouches() {
environment.getOutput().println();
environment.getOutput().println(environment.decoratePrompt(""));
environment.getOutput().flush();
}

View File

@ -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();

View File

@ -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());
}