From 86a03f97d30c11a5321fa2f0fd37cbc4c7f63a32 Mon Sep 17 00:00:00 2001 From: Emil Date: Fri, 14 Sep 2018 23:07:13 +0300 Subject: all: simplify s[:] to s where s is a slice (#17673) --- core/chain_indexer.go | 2 +- core/types/bloom9.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/chain_indexer.go b/core/chain_indexer.go index 89ee75eb2..4bdd4ba1c 100644 --- a/core/chain_indexer.go +++ b/core/chain_indexer.go @@ -445,7 +445,7 @@ func (c *ChainIndexer) AddChildIndexer(indexer *ChainIndexer) { func (c *ChainIndexer) loadValidSections() { data, _ := c.indexDb.Get([]byte("count")) if len(data) == 8 { - c.storedSections = binary.BigEndian.Uint64(data[:]) + c.storedSections = binary.BigEndian.Uint64(data) } } diff --git a/core/types/bloom9.go b/core/types/bloom9.go index a76b6f33c..d045c9e66 100644 --- a/core/types/bloom9.go +++ b/core/types/bloom9.go @@ -113,7 +113,7 @@ func LogsBloom(logs []*Log) *big.Int { } func bloom9(b []byte) *big.Int { - b = crypto.Keccak256(b[:]) + b = crypto.Keccak256(b) r := new(big.Int) @@ -130,7 +130,7 @@ var Bloom9 = bloom9 func BloomLookup(bin Bloom, topic bytesBacked) bool { bloom := bin.Big() - cmp := bloom9(topic.Bytes()[:]) + cmp := bloom9(topic.Bytes()) return bloom.And(bloom, cmp).Cmp(cmp) == 0 } -- cgit v1.2.3