diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:50 +0000 |
commit | 9835e2ae736235810b4ea1c162ca5e65c547e770 (patch) | |
tree | 3fcebf40ed70e581d776a8a4c65923e8ec20e026 /compiler/rustc_index/src/bit_set.rs | |
parent | Releasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff) | |
download | rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip |
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_index/src/bit_set.rs')
-rw-r--r-- | compiler/rustc_index/src/bit_set.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/compiler/rustc_index/src/bit_set.rs b/compiler/rustc_index/src/bit_set.rs index 271ab8306..15bc3b4e3 100644 --- a/compiler/rustc_index/src/bit_set.rs +++ b/compiler/rustc_index/src/bit_set.rs @@ -1,6 +1,3 @@ -use crate::vec::{Idx, IndexVec}; -use arrayvec::ArrayVec; -use smallvec::{smallvec, SmallVec}; use std::fmt; use std::iter; use std::marker::PhantomData; @@ -9,8 +6,13 @@ use std::ops::{BitAnd, BitAndAssign, BitOrAssign, Bound, Not, Range, RangeBounds use std::rc::Rc; use std::slice; +use arrayvec::ArrayVec; +use smallvec::{smallvec, SmallVec}; + use rustc_macros::{Decodable, Encodable}; +use crate::{Idx, IndexVec}; + use Chunk::*; #[cfg(test)] @@ -1542,7 +1544,7 @@ impl<T: Idx> GrowableBitSet<T> { #[inline] pub fn contains(&self, elem: T) -> bool { let (word_index, mask) = word_index_and_mask(elem); - self.bit_set.words.get(word_index).map_or(false, |word| (word & mask) != 0) + self.bit_set.words.get(word_index).is_some_and(|word| (word & mask) != 0) } #[inline] @@ -1816,7 +1818,7 @@ impl<R: Idx, C: Idx> SparseBitMatrix<R, C> { /// if the matrix represents (transitive) reachability, can /// `row` reach `column`? pub fn contains(&self, row: R, column: C) -> bool { - self.row(row).map_or(false, |r| r.contains(column)) + self.row(row).is_some_and(|r| r.contains(column)) } /// Adds the bits from row `read` to the bits from row `write`, and |