aboutsummaryrefslogtreecommitdiff
path: root/src/encoding
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2020-11-06 17:37:03 -0800
committerJosh Bleecher Snyder <josharian@gmail.com>2021-02-25 19:42:00 +0000
commit526ee96f4992ff3a1e1c219fe8dc9870098bacba (patch)
treed7d8d1101ef6e6bfbef121be116694509e115bdf /src/encoding
parent194b636f8f1ff7d6b709b5b9010d1d14b3919e66 (diff)
downloadgo-526ee96f4992ff3a1e1c219fe8dc9870098bacba.tar.xz
os: avoid allocation in File.WriteString
Instead of alloc+copy to convert the string to a byte slice, do an unsafe conversion. Rely on the kernel not to scribble on the buffer during the write. Fixes #42406 Change-Id: I66f4838b43a11bcc3d67bbfa1706726318d55343 Reviewed-on: https://go-review.googlesource.com/c/go/+/268020 Trust: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Diffstat (limited to 'src/encoding')
0 files changed, 0 insertions, 0 deletions