From 3117a4481ef9d87c6b075d23b9ffef76516d008c Mon Sep 17 00:00:00 2001 From: cheatfate Date: Thu, 28 Mar 2019 23:18:36 +0200 Subject: [PATCH] Remove unneeded initialization. --- beacon_chain/spec/digest.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/beacon_chain/spec/digest.nim b/beacon_chain/spec/digest.nim index ad7926117..9bd098eaf 100644 --- a/beacon_chain/spec/digest.nim +++ b/beacon_chain/spec/digest.nim @@ -37,7 +37,9 @@ func shortLog*(x: Eth2Digest): string = func eth2hash*(v: openArray[byte]): Eth2Digest = var ctx: Eth2Hash - ctx.init() + # We can avoid this step for Keccak/SHA3 digests because `ctx` is already + # empty, but if digest will be changed next line must be enabled. + # ctx.init() ctx.update(v) result = ctx.finish()