Commit e3cb3817 authored by Sergey Zagursky's avatar Sergey Zagursky Committed by Matthew Dempsky
Browse files

go/internal/gcimporter: don't waste CPU copying bytes in `io.ReadAll`

`io.ReadAll` dynamically reallocates byte slice because it doesn't know
its size in advance. We don't need to read an entire file into memory
and therefore may use `bufio.Reader` to read its contents.

Fixes #46564

Change-Id: Id504b1512662b6dea4775d523455896fa4162ab3
Reviewed-on: https://go-review.googlesource.com/c/go/+/325429


Reviewed-by: default avatarDominik Honnef <dominik@honnef.co>
Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
Trust: Matthew Dempsky <mdempsky@google.com>
Trust: Dominik Honnef <dominik@honnef.co>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
parent 9d669ed4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment