pub(crate) fn sp_first_one(&self) -> Option<usize> {
		let mut accum = 0;

		match self.domain() {
			Domain::Enclave(elem) => {
				let val = elem.load_value();
				if has_one(val, elem.mask().into_inner()) {
					accum += val.trailing_zeros() as usize
						- elem.head().into_inner() as usize;
					return Some(accum);
				}
				None
			},
			Domain::Region { head, body, tail } => {
				if let Some(elem) = head {
					let val = elem.load_value();
					accum += val.trailing_zeros() as usize
						- elem.head().into_inner() as usize;
					if has_one(val, elem.mask().into_inner()) {
						return Some(accum);
					}
				}

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

				if let Some(elem) = tail {
					let val = elem.load_value();
					if has_one(val, elem.mask().into_inner()) {
						accum += val.trailing_zeros() as usize;
						return Some(accum);
					}
				}

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