mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
tweaks to NAMES implementation (#2058)
* tweaks to NAMES implementation * tweak member caching * add a benchmark for NAMES
This commit is contained in:
parent
378d88fee2
commit
eeec481b8d
8 changed files with 148 additions and 56 deletions
|
|
@ -48,6 +48,13 @@ func BitsetSet(set []uint32, position uint, on bool) (changed bool) {
|
|||
}
|
||||
}
|
||||
|
||||
// BitsetClear clears the bitset in-place.
|
||||
func BitsetClear(set []uint32) {
|
||||
for i := 0; i < len(set); i++ {
|
||||
atomic.StoreUint32(&set[i], 0)
|
||||
}
|
||||
}
|
||||
|
||||
// BitsetEmpty returns whether the bitset is empty.
|
||||
// This has false positives under concurrent modification (i.e., it can return true
|
||||
// even though w.r.t. the sequence of atomic modifications, there was no point at
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue