pub(crate) fn sp_last_one(&self) -> Option<usize> {
		let mut out = self.len().checked_sub(1)?;
		match self.domain() {
			Domain::Enclave(elem) => {
				let val = elem.load_value();
				let dead_bits =
					bits_of::<T::Mem>() - elem.tail().into_inner() as usize;
				if has_one(val, elem.mask().into_inner()) {
					out -= val.trailing_zeros() as usize - dead_bits as usize;
					return Some(out);
				}
				None
			},
			Domain::Region { head, body, tail } => {
				if let Some(elem) = tail {
					let val = elem.load_value();
					let dead_bits =
						bits_of::<T::Mem>() - elem.tail().into_inner() as usize;
					out -= val.trailing_zeros() as usize - dead_bits;
					if has_one(val, elem.mask().into_inner()) {
						return Some(out);
					}
				}

				for val in body.iter().map(BitStore::load_value).rev() {
					out -= val.trailing_zeros() as usize;
					if has_one(val, !<T::Mem as Integral>::ZERO) {
						return Some(out);
					}
				}

				if let Some(elem) = head {
					let val = elem.load_value();
					if has_one(val, elem.mask().into_inner()) {
						out -= val.trailing_zeros() as usize;
						return Some(out);
					}
				}

				None
			},
		}
	}
/// Seeks the index of the last `1` bit in the bit-slice.
Seeks the index of the last `1` bit in the bit-slice.
Seeks the index of the last ` 1 ` bit in the bit - slice .
pub(crate) fn sp_last_one(&self) -> Option<usize> {
		let mut out = self.len().checked_sub(1)?;
		match self.domain() {
			Domain::Enclave(elem) => {
				let val = elem.load_value();
				let dead_bits =
					bits_of::<T::Mem>() - elem.tail().into_inner() as usize;
				if has_one(val, elem.mask().into_inner()) {
					out -= val.trailing_zeros() as usize - dead_bits as usize;
					return Some(out);
				}
				None
			},
			Domain::Region { head, body, tail } => {
				if let Some(elem) = tail {
					let val = elem.load_value();
					let dead_bits =
						bits_of::<T::Mem>() - elem.tail().into_inner() as usize;
					out -= val.trailing_zeros() as usize - dead_bits;
					if has_one(val, elem.mask().into_inner()) {
						return Some(out);
					}
				}
				for val in body.iter().map(BitStore::load_value).rev() {
					out -= val.trailing_zeros() as usize;
					if has_one(val, !<T::Mem as Integral>::ZERO) {
						return Some(out);
					}
				}
				if let Some(elem) = head {
					let val = elem.load_value();
					if has_one(val, elem.mask().into_inner()) {
						out -= val.trailing_zeros() as usize;
						return Some(out);
					}
				}
				None
			},
		}
	}
pub ( crate ) fn sp_last_one ( & self ) -> Option < usize > { let mut out = self . len ( ) . checked_sub ( 1 ) ? ; match self . domain ( ) { Domain :: Enclave ( elem ) => { let val = elem . load_value ( ) ; let dead_bits = bits_of :: < T :: Mem > ( ) - elem . tail ( ) . into_inner ( ) as usize ; if has_one ( val , elem . mask ( ) . into_inner ( ) ) { out -= val . trailing_zeros ( ) as usize - dead_bits as usize ; return Some ( out ) ; } None } , Domain :: Region { head , body , tail } => { if let Some ( elem ) = tail { let val = elem . load_value ( ) ; let dead_bits = bits_of :: < T :: Mem > ( ) - elem . tail ( ) . into_inner ( ) as usize ; out -= val . trailing_zeros ( ) as usize - dead_bits ; if has_one ( val , elem . mask ( ) . into_inner ( ) ) { return Some ( out ) ; } } for val in body . iter ( ) . map ( BitStore :: load_value ) . rev ( ) { out -= val . trailing_zeros ( ) as usize ; if has_one ( val , ! < T :: Mem as Integral > :: ZERO ) { return Some ( out ) ; } } if let Some ( elem ) = head { let val = elem . load_value ( ) ; if has_one ( val , elem . mask ( ) . into_inner ( ) ) { out -= val . trailing_zeros ( ) as usize ; return Some ( out ) ; } } None } , } }
Seeks the index of the last `1` bit in the bit-slice.
Seeks the index of the last ` 1 ` bit in the bit - slice .
&self
&self