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

Commit fcfd239

Browse files
authored
Merge pull request #873 from smola/fix-diff
utils: diff, skip useless rune->string conversion
2 parents 662e2c2 + 7d9b66f commit fcfd239

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)