DiffMainRunes finds the differences between two rune sequences. The checklines flag is a speedup: if false, don't run a line-level diff first to identify the changed areas; if true, run a faster, slightly less optimal diff. If an invalid UTF-8 sequence is encountered, it will be replaced by the Unic
(text1, text2 []rune, checklines bool)
| 90 | // The checklines flag is a speedup: if false, don't run a line-level diff first to identify the changed areas; if true, run a faster, slightly less optimal diff. |
| 91 | // If an invalid UTF-8 sequence is encountered, it will be replaced by the Unicode replacement character. |
| 92 | func (dmp *DiffMatchPatch) DiffMainRunes(text1, text2 []rune, checklines bool) []Diff { |
| 93 | var deadline time.Time |
| 94 | if dmp.DiffTimeout > 0 { |
| 95 | deadline = time.Now().Add(dmp.DiffTimeout) |
| 96 | } |
| 97 | return dmp.diffMainRunes(text1, text2, checklines, deadline) |
| 98 | } |
| 99 | |
| 100 | func (dmp *DiffMatchPatch) diffMainRunes(text1, text2 []rune, checklines bool, deadline time.Time) []Diff { |
| 101 | if runesEqual(text1, text2) { |