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

Method DiffBisect

diffmatchpatch/diff.go:254–257  ·  view source on GitHub ↗

DiffBisect finds the 'middle snake' of a diff, split the problem in two and return the recursively constructed diff. If an invalid UTF-8 sequence is encountered, it will be replaced by the Unicode replacement character. See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.

(text1, text2 string, deadline time.Time)

Source from the content-addressed store, hash-verified

252// If an invalid UTF-8 sequence is encountered, it will be replaced by the Unicode replacement character.
253// See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.
254func (dmp *DiffMatchPatch) DiffBisect(text1, text2 string, deadline time.Time) []Diff {
255 // Unused in this code, but retained for interface compatibility.
256 return dmp.diffBisect([]rune(text1), []rune(text2), deadline)
257}
258
259// diffBisect finds the 'middle snake' of a diff, splits the problem in two and returns the recursively constructed diff.
260// See Myers's 1986 paper: An O(ND) Difference Algorithm and Its Variations.

Callers 1

TestDiffBisectFunction · 0.80

Calls 1

diffBisectMethod · 0.95

Tested by 1

TestDiffBisectFunction · 0.64