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

Method restore_state

regex/src/dfa.rs:1347–1354  ·  view source on GitHub ↗

Restores the given state back into the cache, and returns a pointer to it.

(&mut self, state: State)

Source from the content-addressed store, hash-verified

1345 /// Restores the given state back into the cache, and returns a pointer
1346 /// to it.
1347 fn restore_state(&mut self, state: State) -> Option<StatePtr> {
1348 // If we've already stored this state, just return a pointer to it.
1349 // None will be the wiser.
1350 if let Some(si) = self.cache.compiled.get_ptr(&state) {
1351 return Some(si);
1352 }
1353 self.add_state(state)
1354 }
1355
1356 /// Returns the next state given the current state si and current byte
1357 /// b. {qcur,qnext} are used as scratch space for storing ordered NFA

Callers 2

clear_cache_and_saveMethod · 0.80
clear_cacheMethod · 0.80

Calls 2

get_ptrMethod · 0.80
add_stateMethod · 0.80

Tested by

no test coverage detected