MCPcopy Create free account
hub / github.com/SoftbearStudios/bitcode / any_greater_than

Method any_greater_than

src/length.rs:138–153  ·  view source on GitHub ↗
(&self, length: usize)

Source from the content-addressed store, hash-verified

136 /// Safety: `length` must be the `length` passed to populate.
137 #[cfg_attr(not(feature = "arrayvec"), allow(unused))]
138 pub unsafe fn any_greater_than<const N: usize>(&self, length: usize) -> bool {
139 if N < 255 {
140 // Fast path: don't need to scan large lengths since there shouldn't be any.
141 // A large length will have a 255 in small which will be greater than N.
142 self.small
143 .as_slice(length)
144 .iter()
145 .copied()
146 .max()
147 .unwrap_or(0) as usize
148 > N
149 } else {
150 let mut decoder = self.borrowed_clone();
151 (0..length).any(|_| decoder.decode() > N)
152 }
153 }
154}
155
156impl<'a> View<'a> for LengthDecoder<'a> {

Callers

nothing calls this directly

Calls 3

as_sliceMethod · 0.80
borrowed_cloneMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected