aboutsummaryrefslogtreecommitdiffstats
path: root/utils/diff/diff.go
diff options
context:
space:
mode:
authorMarc Barussaud <marc.barussaud@orange.com>2018-06-26 11:59:22 +0200
committerSantiago M. Mola <santi@mola.io>2018-06-26 14:26:01 +0200
commit7d9b66fd9f707b31ac80c39d8027772de86c291d (patch)
tree9b05036339915bc078e961bfd1027eb0a7daabc4 /utils/diff/diff.go
parent662e2c226e9b8352a90cd1951233fab30a4e5042 (diff)
downloadgo-git-7d9b66fd9f707b31ac80c39d8027772de86c291d.tar.gz
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>
Diffstat (limited to 'utils/diff/diff.go')
-rw-r--r--utils/diff/diff.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/diff/diff.go b/utils/diff/diff.go
index b840ad6..f49ae55 100644
--- a/utils/diff/diff.go
+++ b/utils/diff/diff.go
@@ -16,8 +16,8 @@ import (
// string into the dst string.
func Do(src, dst string) (diffs []diffmatchpatch.Diff) {
dmp := diffmatchpatch.New()
- wSrc, wDst, warray := dmp.DiffLinesToChars(src, dst)
- diffs = dmp.DiffMain(wSrc, wDst, false)
+ wSrc, wDst, warray := dmp.DiffLinesToRunes(src, dst)
+ diffs = dmp.DiffMainRunes(wSrc, wDst, false)
diffs = dmp.DiffCharsToLines(diffs, warray)
return diffs
}