@@ -728,24 +728,24 @@ func (dmp *DiffMatchPatch) DiffCleanupSemantic(diffs []Diff) []Diff {
728
728
overlapLength1 := dmp .DiffCommonOverlap (deletion , insertion )
729
729
overlapLength2 := dmp .DiffCommonOverlap (insertion , deletion )
730
730
if overlapLength1 >= overlapLength2 {
731
- if float64 (overlapLength1 ) >= float64 (len ([] rune ( deletion ) ))/ 2 ||
732
- float64 (overlapLength1 ) >= float64 (len ([] rune ( insertion ) ))/ 2 {
731
+ if float64 (overlapLength1 ) >= float64 (len (deletion ))/ 2 ||
732
+ float64 (overlapLength1 ) >= float64 (len (insertion ))/ 2 {
733
733
734
734
// Overlap found. Insert an equality and trim the surrounding edits.
735
735
diffs = splice (diffs , pointer , 0 , Diff {DiffEqual , insertion [:overlapLength1 ]})
736
736
diffs [pointer - 1 ].Text =
737
- deletion [0 : len ([] rune ( deletion ) )- overlapLength1 ]
737
+ deletion [0 : len (deletion )- overlapLength1 ]
738
738
diffs [pointer + 1 ].Text = insertion [overlapLength1 :]
739
739
pointer ++
740
740
}
741
741
} else {
742
- if float64 (overlapLength2 ) >= float64 (len ([] rune ( deletion ) ))/ 2 ||
743
- float64 (overlapLength2 ) >= float64 (len ([] rune ( insertion ) ))/ 2 {
742
+ if float64 (overlapLength2 ) >= float64 (len (deletion ))/ 2 ||
743
+ float64 (overlapLength2 ) >= float64 (len (insertion ))/ 2 {
744
744
// Reverse overlap found. Insert an equality and swap and trim the surrounding edits.
745
745
overlap := Diff {DiffEqual , deletion [:overlapLength2 ]}
746
746
diffs = splice (diffs , pointer , 0 , overlap )
747
747
diffs [pointer - 1 ].Type = DiffInsert
748
- diffs [pointer - 1 ].Text = insertion [0 : len ([] rune ( insertion ) )- overlapLength2 ]
748
+ diffs [pointer - 1 ].Text = insertion [0 : len (insertion )- overlapLength2 ]
749
749
diffs [pointer + 1 ].Type = DiffDelete
750
750
diffs [pointer + 1 ].Text = deletion [overlapLength2 :]
751
751
pointer ++
0 commit comments