MCPcopy Create free account
hub / github.com/NationalSecurityAgency/TraceAnalysis / get

Method get

dynamic-dataflow/core/src/seqcache.rs:97–119  ·  view source on GitHub ↗
(&self, seq: S)

Source from the content-addressed store, hash-verified

95{
96 #[inline]
97 pub fn get<S>(&self, seq: S) -> Option<Index>
98 where
99 S: AsRef<[T]>,
100 {
101 let seq = seq.as_ref();
102 let Self {
103 dedup,
104 hasher,
105 ends,
106 buffer,
107 marker: _,
108 } = self;
109 let hash = make_hash(hasher, seq);
110 dedup
111 .raw_entry()
112 .from_hash(hash, |index| {
113 // SAFETY: This is safe because we only operate on indices that
114 // we receive from our backend making them valid.
115 let (from, to) = unsafe { index_to_span_unchecked(ends, index.to_usize()) };
116 seq == &buffer[from..to]
117 })
118 .map(|(&index, &())| index)
119 }
120
121 #[inline]
122 pub fn get_or_intern<S>(&mut self, seq: S) -> Index

Callers 4

to_usizeMethod · 0.45
nextMethod · 0.45
resolveMethod · 0.45
index_to_span_uncheckedFunction · 0.45

Calls 4

index_to_span_uncheckedFunction · 0.85
mapMethod · 0.80
to_usizeMethod · 0.80
make_hashFunction · 0.70

Tested by

no test coverage detected