From 432c2a5b261821b0dc82e271cd0dedbdef69e0d8 Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Fri, 6 Dec 2019 16:38:32 +0700 Subject: [PATCH] fix linter warning --- common/dbutils/composite_keys.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/common/dbutils/composite_keys.go b/common/dbutils/composite_keys.go index dc5220b83..223686614 100644 --- a/common/dbutils/composite_keys.go +++ b/common/dbutils/composite_keys.go @@ -35,8 +35,7 @@ func HeaderTDKey(number uint64, hash common.Hash) []byte { func IsHeaderTDKey(k []byte) bool { l := common.BlockNumberLength + common.HashLength + 1 - result := len(k) == l && bytes.Compare(k[l-1:], HeaderTDSuffix) == 0 - return result + return len(k) == l && bytes.Equal(k[l-1:], HeaderTDSuffix) } // headerHashKey = headerPrefix + num (uint64 big endian) + headerHashSuffix @@ -46,8 +45,7 @@ func HeaderHashKey(number uint64) []byte { func IsHeaderHashKey(k []byte) bool { l := common.BlockNumberLength + 1 - result := len(k) == l && bytes.Compare(k[l-1:], HeaderHashSuffix) == 0 - return result + return len(k) == l && bytes.Equal(k[l-1:], HeaderHashSuffix) } // headerNumberKey = headerNumberPrefix + hash