• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vortex-data / vortex / 16728097825

04 Aug 2025 04:00PM UTC coverage: 48.355% (-35.1%) from 83.429%
16728097825

Pull #4108

github

web-flow
Merge 1b2d27fd8 into 649ba9576
Pull Request #4108: perf[vortex-array]: use all_valid instead of `invalid_count() == 0`

1 of 1 new or added line in 1 file covered. (100.0%)

11596 existing lines in 378 files now uncovered.

18635 of 38538 relevant lines covered (48.35%)

151786.4 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

43.75
/vortex-array/src/arrays/primitive/accessor.rs
1
// SPDX-License-Identifier: Apache-2.0
2
// SPDX-FileCopyrightText: Copyright the Vortex contributors
3

4
use std::iter;
5

6
use vortex_dtype::NativePType;
7
use vortex_error::VortexResult;
8

9
use crate::ToCanonical;
10
use crate::accessor::ArrayAccessor;
11
use crate::arrays::primitive::PrimitiveArray;
12
use crate::validity::Validity;
13
use crate::vtable::ValidityHelper;
14

15
impl<T: NativePType> ArrayAccessor<T> for PrimitiveArray {
16
    fn with_iterator<F, R>(&self, f: F) -> VortexResult<R>
2✔
17
    where
2✔
18
        F: for<'a> FnOnce(&mut dyn Iterator<Item = Option<&'a T>>) -> R,
2✔
19
    {
20
        match self.validity() {
2✔
21
            Validity::NonNullable | Validity::AllValid => {
22
                let mut iter = self.as_slice::<T>().iter().map(Some);
2✔
23
                Ok(f(&mut iter))
2✔
24
            }
25
            Validity::AllInvalid => Ok(f(&mut iter::repeat_n(None, self.len()))),
×
UNCOV
26
            Validity::Array(v) => {
×
UNCOV
27
                let validity = v.to_bool()?;
×
UNCOV
28
                let mut iter = self
×
UNCOV
29
                    .as_slice::<T>()
×
UNCOV
30
                    .iter()
×
UNCOV
31
                    .zip(validity.boolean_buffer().iter())
×
UNCOV
32
                    .map(|(value, valid)| valid.then_some(value));
×
UNCOV
33
                Ok(f(&mut iter))
×
34
            }
35
        }
36
    }
2✔
37
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc