diff options
| author | Joe Tsai <joetsai@digital-static.net> | 2022-06-15 17:35:41 -0700 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2022-08-22 23:36:08 +0000 |
| commit | e0388c92d048fc31b39e133441bd4f6d85959ec4 (patch) | |
| tree | 3aaa2c27662dd757742df1730e966fec157e46e3 /src | |
| parent | cd52818487fade395c4d9189ce6e70cc03aeecb2 (diff) | |
| download | go-e0388c92d048fc31b39e133441bd4f6d85959ec4.tar.xz | |
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>
Diffstat (limited to 'src')
| -rw-r--r-- | src/internal/poll/fd_windows.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/internal/poll/fd_windows.go b/src/internal/poll/fd_windows.go index 1ca281b2a4..1af2011f94 100644 --- a/src/internal/poll/fd_windows.go +++ b/src/internal/poll/fd_windows.go @@ -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 |
