MCPcopy Create free account
hub / github.com/carsonpo/haystackdb / decompress_indices

Function decompress_indices

src/structures/inverted_index.rs:135–147  ·  view source on GitHub ↗
(compressed: Vec<usize>)

Source from the content-addressed store, hash-verified

133}
134
135pub fn decompress_indices(compressed: Vec<usize>) -> Vec<usize> {
136 let mut decompressed = Vec::new();
137 let mut i = 0;
138
139 while i < compressed.len() {
140 let start = compressed[i];
141 let count = compressed[i + 1];
142 decompressed.extend((start..start + count).collect::<Vec<usize>>());
143 i += 2; // Move to the next pair
144 }
145
146 decompressed
147}
148
149impl InvertedIndex {
150 pub fn new(path: PathBuf) -> Self {

Callers 2

getMethod · 0.85

Calls 1

lenMethod · 0.80

Tested by 1