MCPcopy Index your code
hub / github.com/codeaashu/claude-code / withCache

Method withCache

src/utils/Cursor.ts:1487–1494  ·  view source on GitHub ↗
(key: string, compute: () => T)

Source from the content-addressed store, hash-verified

1485 }
1486
1487 private withCache<T>(key: string, compute: () => T): T {
1488 const cached = this.navigationCache.get(key)
1489 if (cached !== undefined) return cached as T
1490
1491 const result = compute()
1492 this.navigationCache.set(key, result as number)
1493 return result
1494 }
1495
1496 nextOffset(offset: number): number {
1497 return this.withCache(`next:${offset}`, () => {

Callers 2

nextOffsetMethod · 0.95
prevOffsetMethod · 0.95

Calls 2

getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected