19 lines
312 B
Go
19 lines
312 B
Go
|
package hashmap
|
||
|
|
||
|
type hmBucket struct {
|
||
|
data []bucketNode
|
||
|
}
|
||
|
|
||
|
type bucketNode struct {
|
||
|
hash uint
|
||
|
key, value interface{}
|
||
|
}
|
||
|
|
||
|
func newBucket() *hmBucket {
|
||
|
return &hmBucket{}
|
||
|
}
|
||
|
|
||
|
func (bkt *hmBucket) Add(hash uint, k, v interface{}) {
|
||
|
bkt.data = append(bkt.data, bucketNode{key: k, value: v, hash: hash})
|
||
|
}
|