aboutsummaryrefslogtreecommitdiff
path: root/src/os/exec/exec.go
diff options
context:
space:
mode:
authorJabar Asadi <jasadi@d2iq.com>2023-05-28 06:45:23 +0000
committerGopher Robot <gobot@golang.org>2023-07-25 00:48:06 +0000
commita3a9b1049e59672e4bd56b597b273ef1b07313a0 (patch)
tree2fd056176a577d55b9a2fe2851583c725b6f367b /src/os/exec/exec.go
parentdf0a1297899aff1c46b66523e75aa12b0ff5049f (diff)
downloadgo-a3a9b1049e59672e4bd56b597b273ef1b07313a0.tar.xz
os: ReadFile: don't check for re-allocation in the first iteration
At the beginning of the for-loop iteration cap(data) > len(data) always. Therefore, in the first iteration, this check becomes unnecessary. we can move this check to after the read operation. Change-Id: I205e4a842ced74f31124b45a39b70523b56ad840 GitHub-Last-Rev: 2fdf25dff2e9984d3a8f8e5e612ea802c88e88a1 GitHub-Pull-Request: golang/go#60473 Reviewed-on: https://go-review.googlesource.com/c/go/+/498915 Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Rob Pike <r@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/os/exec/exec.go')
0 files changed, 0 insertions, 0 deletions