• 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

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

4
use vortex_dtype::{NativePType, half};
5

6
/// NativeValue serves as a wrapper type to allow us to implement Hash and Eq on all primitive types.
7
///
8
/// Rust does not define Hash/Eq for any of the float types due to the presence of
9
/// NaN and +/- 0. We don't care about storing multiple NaNs or zeros in our dictionaries,
10
/// so we define simple bit-wise Hash/Eq for the Value-wrapped versions of these types.
11
#[repr(transparent)]
12
#[derive(Copy, Clone, Debug)]
13
pub struct NativeValue<T>(pub T);
14

15
impl<T: NativePType> PartialEq<NativeValue<T>> for NativeValue<T> {
16
    fn eq(&self, other: &NativeValue<T>) -> bool {
22,183,440✔
17
        self.0.is_eq(other.0)
22,183,440✔
18
    }
22,183,440✔
19
}
20

21
impl<T: NativePType> Eq for NativeValue<T> {}
22

23
macro_rules! prim_value {
24
    ($typ:ty) => {
25
        impl core::hash::Hash for NativeValue<$typ> {
26
            fn hash<H: core::hash::Hasher>(&self, state: &mut H) {
30,457,326✔
27
                self.0.hash(state);
30,457,326✔
28
            }
30,457,326✔
29
        }
30
    };
31
}
32

33
macro_rules! float_value {
34
    ($typ:ty) => {
35
        impl core::hash::Hash for NativeValue<$typ> {
UNCOV
36
            fn hash<H: core::hash::Hasher>(&self, state: &mut H) {
×
UNCOV
37
                self.0.to_bits().hash(state);
×
UNCOV
38
            }
×
39
        }
40
    };
41
}
42

43
prim_value!(u8);
44
prim_value!(u16);
45
prim_value!(u32);
46
prim_value!(u64);
47
prim_value!(i8);
48
prim_value!(i16);
49
prim_value!(i32);
50
prim_value!(i64);
51
float_value!(half::f16);
52
float_value!(f32);
53
float_value!(f64);
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