Skip to content

Commit

Permalink
internal/readme: Simplify if condition (#945)
Browse files Browse the repository at this point in the history
Check for "both true" or "both false" is easily implemented as `x == y`.
  • Loading branch information
tylitianrui authored and abhinav committed May 25, 2021
1 parent 2f8e331 commit 2732714
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/readme/readme.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func (b benchmarkRowsByTime) Less(i, j int) bool {
leftZap, rightZap := strings.Contains(left.Name, "zap"), strings.Contains(right.Name, "zap")

// If neither benchmark is for zap or both are, sort by time.
if !(leftZap || rightZap) || (leftZap && rightZap) {
if leftZap == rightZap {
return left.Time.Nanoseconds() < right.Time.Nanoseconds()
}
// Sort zap benchmark first.
Expand Down

0 comments on commit 2732714

Please sign in to comment.