]> Cypherpunks.ru repositories - gostls13.git/commit
slices: simplify Clone a bit
authorBrad Fitzpatrick <bradfitz@golang.org>
Sat, 19 Aug 2023 16:08:38 +0000 (09:08 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sun, 20 Aug 2023 04:12:09 +0000 (04:12 +0000)
commitb581e447394b4ba7a08ea64b214781cae0f4ef6c
tree65fb592a65c80aea200d05f0ba3788f8ae1a85bf
parent0b6ea6bb04e49e5eba614d39bb1334c87fff4f62
slices: simplify Clone a bit

No need for an explicit nil check. Slicing the input slice
down to zero capacity also preserves nil.

Change-Id: I1f53cc485373d0e65971cd87b6243650ac72612c
Reviewed-on: https://go-review.googlesource.com/c/go/+/521037
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/slices/slices.go