MCPcopy Create free account
hub / github.com/sergi/go-diff / diffBisectSplit

Method diffBisectSplit

diffmatchpatch/diff.go:376–388  ·  view source on GitHub ↗
(runes1, runes2 []rune, x, y int,
	deadline time.Time)

Source from the content-addressed store, hash-verified

374}
375
376func (dmp *DiffMatchPatch) diffBisectSplit(runes1, runes2 []rune, x, y int,
377 deadline time.Time) []Diff {
378 runes1a := runes1[:x]
379 runes2a := runes2[:y]
380 runes1b := runes1[x:]
381 runes2b := runes2[y:]
382
383 // Compute both diffs serially.
384 diffs := dmp.diffMainRunes(runes1a, runes2a, false, deadline)
385 diffsb := dmp.diffMainRunes(runes1b, runes2b, false, deadline)
386
387 return append(diffs, diffsb...)
388}
389
390// DiffLinesToChars splits two texts into a list of strings, and educes the texts to a string of hashes where each Unicode character represents one line.
391// It's slightly faster to call DiffLinesToRunes first, followed by DiffMainRunes.

Callers 2

diffBisectMethod · 0.95
TestDiffBisectSplitFunction · 0.80

Calls 1

diffMainRunesMethod · 0.95

Tested by 1

TestDiffBisectSplitFunction · 0.64