MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / equalsSlice

Function equalsSlice

sdk/src/tools/apply-patch.ts:280–297  ·  view source on GitHub ↗
(
  source: string[],
  target: string[],
  start: number,
  mapFn: (value: string) => string,
)

Source from the content-addressed store, hash-verified

278}
279
280function equalsSlice(
281 source: string[],
282 target: string[],
283 start: number,
284 mapFn: (value: string) => string,
285): boolean {
286 if (start + target.length > source.length) {
287 return false
288 }
289
290 for (let i = 0; i < target.length; i += 1) {
291 if (mapFn(source[start + i]!) !== mapFn(target[i]!)) {
292 return false
293 }
294 }
295
296 return true
297}
298
299function findContextCore(
300 lines: string[],

Callers 1

findContextCoreFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected