From 65236641921d516306297d41b5b32e28e5d9c548 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Mon, 29 May 2017 15:41:15 +0100 Subject: [PATCH] fix bug: Counters.DeepEqual handling of nil maps a nil psMap was considered unequal to an empty psMap --- report/counters.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/report/counters.go b/report/counters.go index e5b7bcf3fa..b85386540d 100644 --- a/report/counters.go +++ b/report/counters.go @@ -115,14 +115,11 @@ func (c Counters) String() string { // DeepEqual tests equality with other Counters func (c Counters) DeepEqual(d Counters) bool { - if (c.psMap == nil) != (d.psMap == nil) { + if c.Size() != d.Size() { return false - } else if c.psMap == nil && d.psMap == nil { - return true } - - if c.psMap.Size() != d.psMap.Size() { - return false + if c.Size() == 0 { + return true } equal := true