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)
This commit is contained in:
parent
4e40467dc3
commit
f445103260
1 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue