more memory-efficient implementation of line reading

This commit is contained in:
Shivaram Lingamneni 2020-08-07 01:10:46 -04:00
parent 12bcba01cd
commit c78253fd93
6 changed files with 96 additions and 45 deletions

View file

@ -69,10 +69,6 @@ func (socket *Socket) Read() (string, error) {
if err == io.EOF {
socket.Close()
// process last message properly (such as ERROR/QUIT/etc), just fail next reads/writes
if line != "" {
err = nil
}
}
return line, err