MCPcopy Create free account
hub / github.com/Effect-TS/effect / push

Function push

packages/effect/src/TextDiff.ts:802–810  ·  view source on GitHub ↗
(a: number, b: number, length: number)

Source from the content-addressed store, hash-verified

800): Array<Block> => {
801 const blocks: Array<Block> = []
802 const push = (a: number, b: number, length: number) => {
803 if (length === 0) return
804 const last = blocks[blocks.length - 1]
805 if (last !== undefined && last.a + last.length === a && last.b + last.length === b) {
806 blocks[blocks.length - 1] = { a: last.a, b: last.b, length: last.length + length }
807 } else {
808 blocks.push({ a, b, length })
809 }
810 }
811
812 // Forward and reverse furthest-reaching x per diagonal, offset by n + m + 1
813 const offset = n + m + 1

Callers 1

matchingBlocksFunction · 0.70

Calls 1

pushMethod · 0.65

Tested by

no test coverage detected