Skip to content

Commit 77659f0

Browse files
committed
perf[mask]: check AllTrue/AllFalse in eq
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
1 parent 1082a5d commit 77659f0

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

vortex-mask/src/eq.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

4+
use std::mem;
5+
46
use crate::Mask;
57

68
impl PartialEq for Mask {
@@ -9,6 +11,9 @@ impl PartialEq for Mask {
911
if self.len() != other.len() {
1012
return false;
1113
}
14+
if mem::discriminant(self) == mem::discriminant(other) && !matches!(self, Mask::Values(_)) {
15+
return true;
16+
}
1217
if self.true_count() != other.true_count() {
1318
return false;
1419
}

0 commit comments

Comments
 (0)