structure/hashmap/bucket.go

19 lines
312 B
Go
Raw Normal View History

2019-05-06 09:01:18 +00:00
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})
}