MCPcopy Create free account
hub / github.com/chen3feng/toft / DoAllAreSet

Method DoAllAreSet

container/bitmap.cpp:39–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39bool BitmapBase::DoAllAreSet(const WordType* words, uint64_t num_bits)
40{
41 const size_t last_word_index = num_bits / kBitsPerWord;
42 const size_t tail_bits = num_bits % kBitsPerWord;
43
44 for (size_t i = 0; i < last_word_index; ++i)
45 {
46 if (words[i] != kAllSetMask)
47 return false;
48 }
49
50 if (tail_bits > 0)
51 {
52 WordType tail_word = words[last_word_index];
53 WordType mask = (1ULL << tail_bits) - 1;
54 if ((tail_word & mask) != mask)
55 return false;
56 }
57
58 return true;
59}
60
61bool BitmapBase::DoAllAreClear(const WordType* words, uint64_t num_bits)
62{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected