MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / dedup_in_order

Function dedup_in_order

codegraph-kernel/src/cfnptr.rs:1157–1166  ·  view source on GitHub ↗
(v: Vec<String>)

Source from the content-addressed store, hash-verified

1155 String::from_utf8_lossy(bytes).into_owned()
1156}
1157
1158fn dedup_in_order(v: Vec<String>) -> Vec<String> {
1159 let mut seen = std::collections::HashSet::new();
1160 let mut out = Vec::with_capacity(v.len());
1161 for x in v {
1162 if seen.insert(x.clone()) {
1163 out.push(x);
1164 }
1165 }
1166 out
1167}
1168
1169/// Line start offsets (byte offset of each line's first byte).

Callers 1

scan_fileFunction · 0.85

Calls 2

lenMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected