MCPcopy Create free account
hub / github.com/AdRoll/baker / setBit

Method setBit

pkg/buffercache/bitmap.go:40–45  ·  view source on GitHub ↗

setBit sets bit i (0-based, starting from LSB)

(i int)

Source from the content-addressed store, hash-verified

38
39// setBit sets bit i (0-based, starting from LSB)
40func (bm *bitmap) setBit(i int) {
41 index := i / 64
42 bit := i % 64
43
44 (*bm)[index] |= 1 << bit
45}
46
47// clearBit clears bit i (0-based, starting from LSB)
48func (bm *bitmap) clearBit(i int) {

Callers 2

putMethod · 0.80
Test_bitmap_setBitFunction · 0.80

Calls

no outgoing calls

Tested by 1

Test_bitmap_setBitFunction · 0.64