MCPcopy Create free account
hub / github.com/davidblewett/rure-python / has_visited

Method has_visited

regex/src/backtrack.rs:285–295  ·  view source on GitHub ↗
(&mut self, ip: InstPtr, at: InputAt)

Source from the content-addressed store, hash-verified

283 }
284
285 fn has_visited(&mut self, ip: InstPtr, at: InputAt) -> bool {
286 let k = ip * (self.input.len() + 1) + at.pos();
287 let k1 = k / BIT_SIZE;
288 let k2 = usize_to_u32(1 << (k & (BIT_SIZE - 1)));
289 if self.m.visited[k1] & k2 == 0 {
290 self.m.visited[k1] |= k2;
291 false
292 } else {
293 true
294 }
295 }
296}
297
298fn usize_to_u32(n: usize) -> u32 {

Callers 1

stepMethod · 0.80

Calls 3

usize_to_u32Function · 0.70
lenMethod · 0.45
posMethod · 0.45

Tested by

no test coverage detected