MCPcopy Create free account
hub / github.com/apache/arrow-rs / has_false

Method has_false

arrow-array/src/array/boolean_array.rs:204–213  ·  view source on GitHub ↗

Returns whether there is at least one non-null `false` value in this array. This is more efficient than `false_count() > 0` because it can short-circuit as soon as a `false` value is found, without counting all set bits. Null values are not counted as `false`. Returns `false` for empty arrays.

(&self)

Source from the content-addressed store, hash-verified

202 ///
203 /// Null values are not counted as `false`. Returns `false` for empty arrays.
204 pub fn has_false(&self) -> bool {
205 match self.nulls() {
206 Some(nulls) => {
207 let null_chunks = nulls.inner().bit_chunks().iter_padded();
208 let value_chunks = self.values().bit_chunks().iter_padded();
209 null_chunks.zip(value_chunks).any(|(n, v)| (n & !v) != 0)
210 }
211 None => self.values().has_false(),
212 }
213 }
214
215 /// Returns the boolean value at index `i`.
216 ///

Callers 1

criterion_benchmarkFunction · 0.45

Calls 6

iter_paddedMethod · 0.80
zipMethod · 0.80
nullsMethod · 0.45
bit_chunksMethod · 0.45
innerMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected