bloom support HashCode operation

This commit is contained in:
tursom 2023-04-25 11:36:46 +08:00
parent 3fd29c4cca
commit df588d7275

View File

@ -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