mirror of
https://github.com/golang/go
synced 2024-11-17 07:14:45 -07:00
internal/poll: rely on utf8.AppendRune
This is both simpler and more performant. Change-Id: I398de29230e578fb7caf1765df7b8fe84d4e8876 Reviewed-on: https://go-review.googlesource.com/c/go/+/412336 Run-TryBot: Joseph Tsai <joetsai@digital-static.net> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Auto-Submit: Joseph Tsai <joetsai@digital-static.net> Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
parent
cd52818487
commit
e0388c92d0
@ -500,8 +500,7 @@ func (fd *FD) readConsole(b []byte) (int, error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
n := utf8.EncodeRune(buf[len(buf):cap(buf)], r)
|
||||
buf = buf[:len(buf)+n]
|
||||
buf = utf8.AppendRune(buf, r)
|
||||
}
|
||||
fd.readbyte = buf
|
||||
fd.readbyteOffset = 0
|
||||
|
Loading…
Reference in New Issue
Block a user