mirror of https://github.com/golang/go.git
os: use slices.Clone
Change-Id: I5a3de1b2fe2ebbb6437df5e7cc55e0d8d69c9cd7 Reviewed-on: https://go-review.googlesource.com/c/go/+/657915 Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: David Chase <drchase@google.com>
This commit is contained in:
parent
35139d6e45
commit
bb6a400028
|
|
@ -223,7 +223,7 @@ func splitPathInRoot(s string, prefix, suffix []string) (_ []string, err error)
|
|||
suffix = nil
|
||||
}
|
||||
|
||||
parts := append([]string{}, prefix...)
|
||||
parts := slices.Clone(prefix)
|
||||
i, j := 0, 1
|
||||
for {
|
||||
if j < len(s) && !IsPathSeparator(s[j]) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue