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

Method get

regex/src/compile.rs:977–991  ·  view source on GitHub ↗
(&mut self, key: SuffixCacheKey, pc: InstPtr)

Source from the content-addressed store, hash-verified

975 }
976
977 fn get(&mut self, key: SuffixCacheKey, pc: InstPtr) -> Option<InstPtr> {
978 let hash = self.hash(&key);
979 let pos = &mut self.sparse[hash];
980 if let Some(entry) = self.dense.get(*pos) {
981 if entry.key == key {
982 return Some(entry.pc);
983 }
984 }
985 *pos = self.dense.len();
986 self.dense.push(SuffixCacheEntry {
987 key: key,
988 pc: pc,
989 });
990 None
991 }
992
993 fn clear(&mut self) {
994 self.dense.clear();

Callers 1

c_utf8_seq_Method · 0.45

Calls 3

hashMethod · 0.80
lenMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected