]> Cypherpunks repositories - gostls13.git/commit
bytes: set cap of slices returned by Split and Fields and friends
authorIan Lance Taylor <iant@golang.org>
Mon, 30 Oct 2017 23:05:18 +0000 (16:05 -0700)
committerIan Lance Taylor <iant@golang.org>
Fri, 3 Nov 2017 19:06:15 +0000 (19:06 +0000)
commita9e2479a4453ce1a2b3583212a6e64c99c31bbfe
treec806165bbd78f3d591b51dfadbba3314e396f57e
parent3043c355f430bb304bc0d09d8162632baa028a83
bytes: set cap of slices returned by Split and Fields and friends

This avoids the problem in which appending to a slice returned by
Split can affect subsequent slices.

Fixes #21149.

Change-Id: Ie3df2b9ceeb9605d4625f47d49073c5f348cf0a1
Reviewed-on: https://go-review.googlesource.com/74510
Reviewed-by: Jelte Fennema <github-tech@jeltef.nl>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/bytes/bytes.go
src/bytes/bytes_test.go