aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKen Thompson <ken@golang.org>2008-11-18 19:59:56 -0800
committerKen Thompson <ken@golang.org>2008-11-18 19:59:56 -0800
commit497e648e7ec0bb98e2c46e5facbe5ae3837b8312 (patch)
tree82d5a2315b38421b911115fa69ee3bc0ff1570e5 /src
parentb2b4e7fa553d8617e8695fd0614545f9283b34ad (diff)
downloadgo-497e648e7ec0bb98e2c46e5facbe5ae3837b8312.tar.xz
perm is [] instead of map
R=r OCL=19569 CL=19569
Diffstat (limited to 'src')
-rw-r--r--src/lib/rand.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/rand.go b/src/lib/rand.go
index ef122d4a92..7636661148 100644
--- a/src/lib/rand.go
+++ b/src/lib/rand.go
@@ -14,7 +14,7 @@ package rand
// urand32 - return random uint32
// nrand, nrand31, nrand63 - return 0 <= random < n
// frand, frand64, frand32 - return 0 <= random float, float64, float32 < 1
-// perm gives a random permutation map[int]int
+// perm gives a random permutation []int
const
(
@@ -164,9 +164,9 @@ frand() float
}
export func
-perm(n int) *map[int]int
+perm(n int) *[]int
{
- m := new(map[int]int);
+ m := new([]int, n);
for i:=0; i<n; i++ {
m[i] = i;
}