aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/slice.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2016-03-13 15:22:45 -0700
committerMatthew Dempsky <mdempsky@google.com>2016-03-13 23:34:31 +0000
commitd1341d6cf300ea29e4ac50037d950b4d7a110073 (patch)
tree844ac625de95eb75488877cb242fe2e59d7e0da4 /src/runtime/slice.go
parent8ec80176d49d268beb282ec32ee9fe7275ef170b (diff)
downloadgo-d1341d6cf300ea29e4ac50037d950b4d7a110073.tar.gz
go-d1341d6cf300ea29e4ac50037d950b4d7a110073.zip
cmd/compile, runtime: eliminate growslice_n
Fixes #11419. Change-Id: I7935a253e3e96191a33f5041bab203ecc5f0c976 Reviewed-on: https://go-review.googlesource.com/20647 Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/runtime/slice.go')
-rw-r--r--src/runtime/slice.go11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/runtime/slice.go b/src/runtime/slice.go
index bbd3e99523..c67862ebac 100644
--- a/src/runtime/slice.go
+++ b/src/runtime/slice.go
@@ -33,17 +33,6 @@ func makeslice(t *slicetype, len64, cap64 int64) slice {
return slice{p, len, cap}
}
-// growslice_n is a variant of growslice that takes the number of new elements
-// instead of the new minimum capacity.
-// TODO(rsc): This is used by append(slice, slice...).
-// The compiler should change that code to use growslice directly (issue #11419).
-func growslice_n(t *slicetype, old slice, n int) slice {
- if n < 1 {
- panic(errorString("growslice: invalid n"))
- }
- return growslice(t, old, old.cap+n)
-}
-
// growslice handles slice growth during append.
// It is passed the slice type, the old slice, and the desired new minimum capacity,
// and it returns a new slice with at least that capacity, with the old data