summaryrefslogtreecommitdiff
path: root/src/lib/container/array/array.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-01-06 15:19:02 -0800
committerRuss Cox <rsc@golang.org>2009-01-06 15:19:02 -0800
commite684aa575c07e0c3b15d959ff4b06d9d8787597a (patch)
treef3f98baba1fdd5e0138a4875884aa85111308b3f /src/lib/container/array/array.go
parent2e8a2665111620da74f35212abc1414c1bab4bad (diff)
downloadgolang-e684aa575c07e0c3b15d959ff4b06d9d8787597a.tar.gz
new new & make
R=r OCL=22166 CL=22166
Diffstat (limited to 'src/lib/container/array/array.go')
-rw-r--r--src/lib/container/array/array.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/container/array/array.go b/src/lib/container/array/array.go
index e87f4266b..241e8d9e9 100644
--- a/src/lib/container/array/array.go
+++ b/src/lib/container/array/array.go
@@ -22,7 +22,7 @@ func (p *Array) Init(initial_len int) *Array {
if initial_len > n {
n = initial_len
}
- a = new([]Element, n);
+ a = make([]Element, n);
} else {
// nil out entries
for j := len(a) - 1; j >= 0; j-- {
@@ -36,7 +36,7 @@ func (p *Array) Init(initial_len int) *Array {
export func New(len int) *Array {
- return new(*Array).Init(len)
+ return new(Array).Init(len)
}
@@ -66,7 +66,7 @@ func (p *Array) Insert(i int, x Element) {
// grow array by doubling its capacity
if n == cap(a) {
- b := new([]Element, 2*n);
+ b := make([]Element, 2*n);
for j := n-1; j >= 0; j-- {
b[j] = a[j];
}