From f5489a1eed911299617bc1ec9523e7320f6b57c2 Mon Sep 17 00:00:00 2001 From: Guillaume de Sagazan Date: Tue, 20 Aug 2019 09:56:13 +0200 Subject: [PATCH] simplifying mapTypesDiffer --- diff/map.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/diff/map.go b/diff/map.go index 65ee474..242164f 100644 --- a/diff/map.go +++ b/diff/map.go @@ -85,13 +85,7 @@ func mapTypesDiffer(lhs, rhs interface{}) (bool, error) { rhsElType := rhsVal.Type().Elem() rhsKeyType := rhsVal.Type().Key() - if lhsElType.Kind() != rhsElType.Kind() { - return true, nil - } else if lhsKeyType.Kind() != rhsKeyType.Kind() { - return true, nil - } - - return false, nil + return lhsElType.Kind() != rhsElType.Kind() || lhsKeyType.Kind() != rhsKeyType.Kind(), nil } func (m mapDiff) Diff() Type {