diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2018-06-27 12:08:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-27 12:08:34 +0200 |
commit | fcfd239c49baee9195f7b8234f46288a29c3951c (patch) | |
tree | 9b05036339915bc078e961bfd1027eb0a7daabc4 | |
parent | 662e2c226e9b8352a90cd1951233fab30a4e5042 (diff) | |
parent | 7d9b66fd9f707b31ac80c39d8027772de86c291d (diff) | |
download | go-git-fcfd239c49baee9195f7b8234f46288a29c3951c.tar.gz |
Merge pull request #873 from smola/fix-diff
utils: diff, skip useless rune->string conversion
-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 } |