From 4223e1f9d53bf769aada5a9ee0e2703d7029b23d Mon Sep 17 00:00:00 2001 From: Dan Laine Date: Tue, 16 Jun 2020 17:51:49 -0400 Subject: [PATCH] remove unnecessary call to Has --- vms/components/state/state.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/vms/components/state/state.go b/vms/components/state/state.go index d4d0da8..24b50e3 100644 --- a/vms/components/state/state.go +++ b/vms/components/state/state.go @@ -128,19 +128,10 @@ func (s *state) Get(db database.Database, typeID uint64, key ids.ID) (interface{ // The unique ID of this key/typeID pair uID := s.uniqueID(key, typeID) - // See if exists in database - exists, err := db.Has(uID.Bytes()) - if err != nil { - return nil, err - } - if !exists { - return nil, database.ErrNotFound - } - // Get the value from the database valueBytes, err := db.Get(uID.Bytes()) if err != nil { - return nil, fmt.Errorf("problem getting value from database: %w", err) + return nil, err } // Unmarshal the value from bytes and return it