mirror of
https://github.com/tursom/GoCollections.git
synced 2025-03-13 08:30:11 +08:00
some bug fix
This commit is contained in:
parent
6527759d1e
commit
5f6a994c48
@ -86,6 +86,7 @@ func (b *Bloom) Contains(data []byte) bool {
|
||||
}
|
||||
|
||||
func (b *Bloom) Add(data []byte) {
|
||||
b.hashCode = 0
|
||||
b.c++
|
||||
for i := 0; i < int(b.k); i++ {
|
||||
hashCode := uint(HashFunc(data, uint32(i)))
|
||||
@ -142,6 +143,7 @@ func (b *Bloom) Merge(t *Bloom) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
b.hashCode = 0
|
||||
for i := range b.m {
|
||||
b.m[i] |= t.m[i]
|
||||
}
|
||||
@ -154,6 +156,7 @@ func (b *Bloom) MergeBM(bitMap []byte) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
b.hashCode = 0
|
||||
for i := range b.m {
|
||||
b.m[i] |= lang.UInt8(bitMap[i])
|
||||
}
|
||||
|
1
util/curry/curry.go
Normal file
1
util/curry/curry.go
Normal file
@ -0,0 +1 @@
|
||||
package curry
|
@ -36,6 +36,7 @@ func MultiMap[V, R any](values <-chan V, m func(value V) R) <-chan R {
|
||||
|
||||
c := atomic.Int32(1)
|
||||
for value0 := range values {
|
||||
c.Add(1)
|
||||
value := value0
|
||||
go func() {
|
||||
rc <- m(value)
|
||||
|
Loading…
Reference in New Issue
Block a user