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

Method DiffLinesToChars

diffmatchpatch/diff.go:392–395  ·  view source on GitHub ↗

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. It's slightly faster to call DiffLinesToRunes first, followed by DiffMainRunes.

(text1, text2 string)

Source from the content-addressed store, hash-verified

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.
392func (dmp *DiffMatchPatch) DiffLinesToChars(text1, text2 string) (string, string, []string) {
393 chars1, chars2, lineArray := dmp.diffLinesToStrings(text1, text2)
394 return chars1, chars2, lineArray
395}
396
397// DiffLinesToRunes splits two texts into a list of runes.
398func (dmp *DiffMatchPatch) DiffLinesToRunes(text1, text2 string) ([]rune, []rune, []string) {

Callers 3

TestDiffLinesToCharsFunction · 0.80
TestDiffPartialLineIndexFunction · 0.80

Calls 1

diffLinesToStringsMethod · 0.95

Tested by 3

TestDiffLinesToCharsFunction · 0.64
TestDiffPartialLineIndexFunction · 0.64