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

Method select_random

hail-fuzz/src/i2s/finder.rs:135–141  ·  view source on GitHub ↗
(&self, rng: &mut R)

Source from the content-addressed store, hash-verified

133 }
134
135 pub(crate) fn select_random<R: Rng>(&self, rng: &mut R) -> CmpCursor {
136 let total = self.len();
137 if total == 0 {
138 return CmpCursor { array: 0, offset: 0 };
139 }
140 self.cursor_from_offset(rng.gen_range(0..total))
141 }
142
143 fn cursor_from_offset(&self, mut offset: usize) -> CmpCursor {
144 let mut array = 0;

Callers 1

random_replaceMethod · 0.80

Calls 2

cursor_from_offsetMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected