Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit 7d9b66f

Browse files
Marc Barussaudsmola
authored andcommitted
utils: diff, skip useless rune->string conversion
According to library documentation : https://github.com/sergi/go-diff/blob/master/diffmatchpatch/diff.go#L391 Signed-off-by: Marc Barussaud <marc.barussaud@orange.com>
1 parent 662e2c2 commit 7d9b66f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

utils/diff/diff.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import (
1616
// string into the dst string.
1717
func Do(src, dst string) (diffs []diffmatchpatch.Diff) {
1818
dmp := diffmatchpatch.New()
19-
wSrc, wDst, warray := dmp.DiffLinesToChars(src, dst)
20-
diffs = dmp.DiffMain(wSrc, wDst, false)
19+
wSrc, wDst, warray := dmp.DiffLinesToRunes(src, dst)
20+
diffs = dmp.DiffMainRunes(wSrc, wDst, false)
2121
diffs = dmp.DiffCharsToLines(diffs, warray)
2222
return diffs
2323
}

0 commit comments

Comments
 (0)