diff options
author | Marc Barussaud <marc.barussaud@orange.com> | 2018-06-26 11:59:22 +0200 |
---|---|---|
committer | Santiago M. Mola <santi@mola.io> | 2018-06-26 14:26:01 +0200 |
commit | 7d9b66fd9f707b31ac80c39d8027772de86c291d (patch) | |
tree | 9b05036339915bc078e961bfd1027eb0a7daabc4 /utils | |
parent | 662e2c226e9b8352a90cd1951233fab30a4e5042 (diff) | |
download | go-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')
-rw-r--r-- | utils/diff/diff.go | 4 |
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 } |