aboutsummaryrefslogtreecommitdiff
path: root/cmp/report_slices.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmp/report_slices.go')
-rw-r--r--cmp/report_slices.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmp/report_slices.go b/cmp/report_slices.go
index 2ad3bc8..68b5c1a 100644
--- a/cmp/report_slices.go
+++ b/cmp/report_slices.go
@@ -80,7 +80,7 @@ func (opts formatOptions) CanFormatDiffSlice(v *valueNode) bool {
}
// Use specialized string diffing for longer slices or strings.
- const minLength = 64
+ const minLength = 32
return vx.Len() >= minLength && vy.Len() >= minLength
}
@@ -563,10 +563,10 @@ func cleanupSurroundingIdentical(groups []diffStats, eq func(i, j int) bool) []d
nx := ds.NumIdentical + ds.NumRemoved + ds.NumModified
ny := ds.NumIdentical + ds.NumInserted + ds.NumModified
var numLeadingIdentical, numTrailingIdentical int
- for i := 0; i < nx && i < ny && eq(ix+i, iy+i); i++ {
+ for j := 0; j < nx && j < ny && eq(ix+j, iy+j); j++ {
numLeadingIdentical++
}
- for i := 0; i < nx && i < ny && eq(ix+nx-1-i, iy+ny-1-i); i++ {
+ for j := 0; j < nx && j < ny && eq(ix+nx-1-j, iy+ny-1-j); j++ {
numTrailingIdentical++
}
if numIdentical := numLeadingIdentical + numTrailingIdentical; numIdentical > 0 {