allocate buffer once, outside the key loop

This commit is contained in:
Martin Angers 2020-03-26 10:52:03 -04:00 committed by Garrett D'Amore
parent 8ec73b6fa6
commit 1b5e88726b
1 changed files with 1 additions and 1 deletions

View File

@ -1351,9 +1351,9 @@ func (t *tScreen) mainLoop() {
} }
func (t *tScreen) inputLoop() { func (t *tScreen) inputLoop() {
chunk := make([]byte, 128)
for { for {
chunk := make([]byte, 128)
n, e := t.in.Read(chunk) n, e := t.in.Read(chunk)
switch e { switch e {
case io.EOF: case io.EOF: