diff options
| author | Josh Bleecher Snyder <josharian@gmail.com> | 2020-11-06 17:37:03 -0800 |
|---|---|---|
| committer | Josh Bleecher Snyder <josharian@gmail.com> | 2021-02-25 19:42:00 +0000 |
| commit | 526ee96f4992ff3a1e1c219fe8dc9870098bacba (patch) | |
| tree | d7d8d1101ef6e6bfbef121be116694509e115bdf /src/encoding | |
| parent | 194b636f8f1ff7d6b709b5b9010d1d14b3919e66 (diff) | |
| download | go-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
