From f4451032609e4fcd5c0b42c26c570d480cd4b43a Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Mon, 12 Aug 2019 18:08:39 +0300 Subject: [PATCH] pkg/vm/stack: fix S1002 gosimple warnings in map.go S1002: should omit comparison to bool constant, can be simplified to ok.Value() (from gosimple) --- pkg/vm/stack/map.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/vm/stack/map.go b/pkg/vm/stack/map.go index b8e462c71..9db2d6e4d 100644 --- a/pkg/vm/stack/map.go +++ b/pkg/vm/stack/map.go @@ -43,7 +43,7 @@ func (m *Map) ContainsKey(key Item) (*Boolean, error) { for k := range m.Value() { if ok, err := CompareHash(k, key); err != nil { return nil, err - } else if ok.Value() == true { + } else if ok.Value() { return ok, nil } @@ -63,7 +63,7 @@ func (m *Map) Remove(key Item) error { for k := range m.Value() { if ok, err := CompareHash(k, key); err != nil { return err - } else if ok.Value() == true { + } else if ok.Value() { d = k } @@ -80,7 +80,7 @@ func (m *Map) Add(key Item, value Item) error { for k := range m.Value() { if ok, err := CompareHash(k, key); err != nil { return err - } else if ok.Value() == true { + } else if ok.Value() { return errors.New("try to insert duplicate key! ") } } @@ -94,7 +94,7 @@ func (m *Map) ValueOfKey(key Item) (Item, error) { for k, v := range m.Value() { if ok, err := CompareHash(k, key); err != nil { return nil, err - } else if ok.Value() == true { + } else if ok.Value() { return v, nil }