MCPcopy
hub / github.com/colbymchenry/codegraph / set

Method set

src/resolution/lru-cache.ts:46–57  ·  view source on GitHub ↗
(key: K, value: V)

Source from the content-addressed store, hash-verified

44 }
45
46 set(key: K, value: V): void {
47 if (this.store.has(key)) {
48 this.store.delete(key);
49 } else if (this.store.size >= this.max) {
50 // Evict the oldest entry — first key in iteration order.
51 const oldest = this.store.keys().next().value;
52 if (oldest !== undefined) {
53 this.store.delete(oldest);
54 }
55 }
56 this.store.set(key, value);
57 }
58
59 clear(): void {
60 this.store.clear();

Callers 15

loadParsedConfigFunction · 0.80
feedMethod · 0.80
storeExtractionResultMethod · 0.80
syncMethod · 0.80
getChangedFilesMethod · 0.80
spawnOneMethod · 0.80
dispatchMethod · 0.80
loadGrammarsForLanguagesFunction · 0.80
getParserFunction · 0.80
parse-worker.tsFile · 0.80
captureValueRefScopeMethod · 0.80
bumpMethod · 0.80

Calls 1

hasMethod · 0.80

Tested by 3

makeContextFunction · 0.64
makeContextFunction · 0.64
tGraphFunction · 0.64