MCPcopy Create free account
hub / github.com/activeloopai/deeplake / any

Method any

cpp/icm/bit_vector.hpp:2151–2178  ·  view source on GitHub ↗

Utility methods - optimized block-level operations

Source from the content-addressed store, hash-verified

2149
2150 // Utility methods - optimized block-level operations
2151 bool any() const
2152 {
2153 const block_type* blocks = original_bv_->data() + start_block_;
2154 int64_t num_blocks = end_block_ - start_block_;
2155
2156 // Check complete blocks
2157 for (int64_t i = 0; i < num_blocks - 1; ++i) {
2158 if (blocks[i] != 0) {
2159 return true;
2160 }
2161 }
2162
2163 // Check last block (may be partial)
2164 if (num_blocks > 0) {
2165 if (end_bit_offset_ != 0) {
2166 block_type mask = (block_type(1) << end_bit_offset_) - 1;
2167 if ((blocks[num_blocks - 1] & mask) != 0) {
2168 return true;
2169 }
2170 } else {
2171 if (blocks[num_blocks - 1] != 0) {
2172 return true;
2173 }
2174 }
2175 }
2176
2177 return false;
2178 }
2179
2180 bool none() const
2181 {

Callers

nothing calls this directly

Calls 1

dataMethod · 0.45

Tested by

no test coverage detected