MCPcopy
hub / github.com/cloudreve/cloudreve / Set

Function Set

pkg/boolset/boolset.go:76–86  ·  view source on GitHub ↗

Set sets a BooleanSet value.

(flag T, enabled bool, bs *BooleanSet)

Source from the content-addressed store, hash-verified

74
75// Set sets a BooleanSet value.
76func Set[T constraints.Integer](flag T, enabled bool, bs *BooleanSet) {
77 if len(*bs) < int(flag/8)+1 {
78 *bs = append(*bs, make([]byte, int(flag/8)+1-len(*bs))...)
79 }
80
81 if enabled {
82 (*bs)[flag/8] |= 1 << uint(flag%8)
83 } else {
84 (*bs)[flag/8] &= ^(1 << uint(flag%8))
85 }
86}

Callers 8

validateAndGetBsMethod · 0.92
EncodeMethod · 0.92
migrateWebdavMethod · 0.92
TestSetFunction · 0.85
TestGetFunction · 0.85
TestDeletesFunction · 0.85
TestGetSettingsFunction · 0.85
SetsFunction · 0.85

Calls

no outgoing calls

Tested by 4

TestSetFunction · 0.68
TestGetFunction · 0.68
TestDeletesFunction · 0.68
TestGetSettingsFunction · 0.68