MCPcopy Create free account
hub / github.com/MultiFuzz/MultiFuzz / cursor_from_offset

Method cursor_from_offset

hail-fuzz/src/i2s/finder.rs:143–171  ·  view source on GitHub ↗
(&self, mut offset: usize)

Source from the content-addressed store, hash-verified

141 }
142
143 fn cursor_from_offset(&self, mut offset: usize) -> CmpCursor {
144 let mut array = 0;
145
146 if offset < self.u8.len() {
147 return CmpCursor { array, offset };
148 }
149 offset -= self.u8.len();
150 array += 1;
151
152 if offset < self.u16.len() {
153 return CmpCursor { array, offset };
154 }
155 offset -= self.u16.len();
156 array += 1;
157
158 if offset < self.u32.len() {
159 return CmpCursor { array, offset };
160 }
161 offset -= self.u32.len();
162 array += 1;
163
164 if offset < self.u64.len() {
165 return CmpCursor { array, offset };
166 }
167 offset -= self.u64.len();
168 array += 1;
169
170 CmpCursor { array, offset }
171 }
172}
173
174pub(crate) enum Operands<'a> {

Callers 1

select_randomMethod · 0.80

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected