MCPcopy Create free account
hub / github.com/argumentcomputer/ix / insert

Method insert

crates/aiur/src/querymap.rs:114–133  ·  view source on GitHub ↗

Append a new entry. The key must not already be present: call sites only insert on a confirmed miss, and a same-key re-entrant call would loop forever before reaching its own insert.

(&mut self, key: &[G], output: &[G], multiplicity: G)

Source from the content-addressed store, hash-verified

112
113 #[cfg(target_os = "linux")]
114 #[inline]
115 fn slice(&self, start: usize, len: usize) -> &[T] {
116 debug_assert!(start + len <= self.len);
117 unsafe { std::slice::from_raw_parts(self.ptr.add(start), len) }
118 }
119
120 #[cfg(not(target_os = "linux"))]
121 #[inline]
122 fn slice(&self, start: usize, len: usize) -> &[T] {
123 &self.inner[start..start + len]
124 }
125
126 #[cfg(target_os = "linux")]
127 #[inline]
128 fn slice_mut(&mut self, start: usize, len: usize) -> &mut [T] {
129 debug_assert!(start + len <= self.len);
130 unsafe { std::slice::from_raw_parts_mut(self.ptr.add(start), len) }
131 }
132
133 #[cfg(not(target_os = "linux"))]
134 #[inline]
135 fn slice_mut(&mut self, start: usize, len: usize) -> &mut [T] {
136 &mut self.inner[start..start + len]

Callers 3

set_infoMethod · 0.45
executeMethod · 0.45
build_klimbs_u64Function · 0.45

Calls 4

hash_g_sliceFunction · 0.85
pushMethod · 0.80
is_emptyMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected