diff options
| author | Russ Cox <rsc@golang.org> | 2010-09-30 14:59:41 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2010-09-30 14:59:41 -0400 |
| commit | bee2d5b0ad241bb15ce79d22661a12dd01f8e992 (patch) | |
| tree | 4b44eaec98a9239e65987f0013197bbedde30df4 /test/hashmap.go | |
| parent | 6117652d8d815faf1fc800ea10aeaee8eceaec3f (diff) | |
| download | go-bee2d5b0ad241bb15ce79d22661a12dd01f8e992.tar.xz | |
gc, spec, tests: no auto-indirect of pointer to interface value
Implies no embedding of pointer to interface value either.
R=gri, iant, ken2, r, r2
CC=golang-dev
https://golang.org/cl/2289041
Diffstat (limited to 'test/hashmap.go')
| -rwxr-xr-x | test/hashmap.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/hashmap.go b/test/hashmap.go index 096ece0a53..0a4d7ab61e 100755 --- a/test/hashmap.go +++ b/test/hashmap.go @@ -21,7 +21,7 @@ func ASSERT(p bool) { type KeyType interface { Hash() uint32 - Match(other *KeyType) bool + Match(other KeyType) bool } @@ -31,8 +31,8 @@ type ValueType interface { type Entry struct { - key *KeyType - value *ValueType + key KeyType + value ValueType } @@ -68,7 +68,7 @@ func (m *HashMap) Initialize (initial_log2_capacity uint32) { } -func (m *HashMap) Probe (key *KeyType) *Entry { +func (m *HashMap) Probe (key KeyType) *Entry { ASSERT(key != nil) var i uint32 = key.Hash() % m.capacity() @@ -86,7 +86,7 @@ func (m *HashMap) Probe (key *KeyType) *Entry { } -func (m *HashMap) Lookup (key *KeyType, insert bool) *Entry { +func (m *HashMap) Lookup (key KeyType, insert bool) *Entry { // Find a matching entry. var p *Entry = m.Probe(key) if p.key != nil { @@ -145,7 +145,7 @@ func (n *Number) Hash() uint32 { } -func (n *Number) Match(other *KeyType) bool { +func (n *Number) Match(other KeyType) bool { // var y *Number = other // return n.x == y.x return false |
