aboutsummaryrefslogtreecommitdiff
path: root/cmp/report_slices.go
diff options
context:
space:
mode:
authorChristian Muehlhaeuser <muesli@gmail.com>2019-08-01 23:37:55 +0200
committerJoe Tsai <joetsai@digital-static.net>2019-08-01 14:37:55 -0700
commit6d8cafd2f64fe3cd66b7530d95df066b00bdd777 (patch)
tree6f4fc42ed92094d521d9a962b2e23b60dd5dab14 /cmp/report_slices.go
parent00cb0dc383d0b3bc6ef9b8be55dc8c11f7d2f20a (diff)
downloadgo-cmp-6d8cafd2f64fe3cd66b7530d95df066b00bdd777.tar.gz
Simplify code (#149)
- No need to wrap ToUpper & Fields - Simpler concatenation - Easier pointer access
Diffstat (limited to 'cmp/report_slices.go')
-rw-r--r--cmp/report_slices.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmp/report_slices.go b/cmp/report_slices.go
index 8cb3265..667a6e3 100644
--- a/cmp/report_slices.go
+++ b/cmp/report_slices.go
@@ -322,7 +322,7 @@ func coalesceInterveningIdentical(groups []diffStats, windowSize int) []diffStat
hadX, hadY := prev.NumRemoved > 0, prev.NumInserted > 0
hasX, hasY := next.NumRemoved > 0, next.NumInserted > 0
if ((hadX || hasX) && (hadY || hasY)) && curr.NumIdentical <= windowSize {
- *prev = (*prev).Append(*curr).Append(*next)
+ *prev = prev.Append(*curr).Append(*next)
groups = groups[:len(groups)-1] // Truncate off equal group
continue
}