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

Method withCache

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

Source from the content-addressed store, hash-verified

1460 }
1461
1462 private withCache<T>(key: string, compute: () => T): T {
1463 const cached = this.navigationCache.get(key)
1464 if (cached !== undefined) return cached as T
1465
1466 const result = compute()
1467 this.navigationCache.set(key, result as number)
1468 return result
1469 }
1470
1471 nextOffset(offset: number): number {
1472 return this.withCache(`next:${offset}`, () => {

Callers 2

nextOffsetMethod · 0.95
prevOffsetMethod · 0.95

Calls 2

setMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected