mirror of
https://github.com/tursom/GoCollections.git
synced 2025-03-13 17:00:18 +08:00
bloom support HashCode operation
This commit is contained in:
parent
3fd29c4cca
commit
df588d7275
@ -127,6 +127,10 @@ func (b *Bloom) Equals(t lang.Object) bool {
|
|||||||
return tb.k == b.k && bytes.Compare(b.m.Bytes(), tb.m.Bytes()) == 0
|
return tb.k == b.k && bytes.Compare(b.m.Bytes(), tb.m.Bytes()) == 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (b *Bloom) HashCode() int32 {
|
||||||
|
return int32(murmur3.Sum32(b.m.Bytes()))
|
||||||
|
}
|
||||||
|
|
||||||
func (b *Bloom) Merge(t *Bloom) bool {
|
func (b *Bloom) Merge(t *Bloom) bool {
|
||||||
if b.k != t.k {
|
if b.k != t.k {
|
||||||
return false
|
return false
|
||||||
|
Loading…
Reference in New Issue
Block a user