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

Method DiffMainRunes

diffmatchpatch/diff.go:90–96  ·  view source on GitHub ↗

DiffMainRunes finds the differences between two rune sequences. If an invalid UTF-8 sequence is encountered, it will be replaced by the Unicode replacement character.

(text1, text2 []rune, checklines bool)

Source from the content-addressed store, hash-verified

88// DiffMainRunes finds the differences between two rune sequences.
89// If an invalid UTF-8 sequence is encountered, it will be replaced by the Unicode replacement character.
90func (dmp *DiffMatchPatch) DiffMainRunes(text1, text2 []rune, checklines bool) []Diff {
91 var deadline time.Time
92 if dmp.DiffTimeout > 0 {
93 deadline = time.Now().Add(dmp.DiffTimeout)
94 }
95 return dmp.diffMainRunes(text1, text2, checklines, deadline)
96}
97
98func (dmp *DiffMatchPatch) diffMainRunes(text1, text2 []rune, checklines bool, deadline time.Time) []Diff {
99 if runesEqual(text1, text2) {

Callers 3

DiffMainMethod · 0.95

Calls 1

diffMainRunesMethod · 0.95