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

Method diffBisectSplit

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

Source from the content-addressed store, hash-verified

376}
377
378func (dmp *DiffMatchPatch) diffBisectSplit(runes1, runes2 []rune, x, y int,
379 deadline time.Time) []Diff {
380 runes1a := runes1[:x]
381 runes2a := runes2[:y]
382 runes1b := runes1[x:]
383 runes2b := runes2[y:]
384
385 // Compute both diffs serially.
386 diffs := dmp.diffMainRunes(runes1a, runes2a, false, deadline)
387 diffsb := dmp.diffMainRunes(runes1b, runes2b, false, deadline)
388
389 return append(diffs, diffsb...)
390}
391
392// 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.
393// 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