Skip to content

Commit 290a6a2

Browse files
authored
Avoid shadowing variable (#263)
Rename the shadowed variable i to j for better readability.
1 parent 248ccff commit 290a6a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: cmp/report_slices.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -563,10 +563,10 @@ func cleanupSurroundingIdentical(groups []diffStats, eq func(i, j int) bool) []d
563563
nx := ds.NumIdentical + ds.NumRemoved + ds.NumModified
564564
ny := ds.NumIdentical + ds.NumInserted + ds.NumModified
565565
var numLeadingIdentical, numTrailingIdentical int
566-
for i := 0; i < nx && i < ny && eq(ix+i, iy+i); i++ {
566+
for j := 0; j < nx && j < ny && eq(ix+j, iy+j); j++ {
567567
numLeadingIdentical++
568568
}
569-
for i := 0; i < nx && i < ny && eq(ix+nx-1-i, iy+ny-1-i); i++ {
569+
for j := 0; j < nx && j < ny && eq(ix+nx-1-j, iy+ny-1-j); j++ {
570570
numTrailingIdentical++
571571
}
572572
if numIdentical := numLeadingIdentical + numTrailingIdentical; numIdentical > 0 {

0 commit comments

Comments
 (0)