Make the code compile in Nim 0.19.0

This commit is contained in:
Zahary Karadjov 2019-01-11 18:41:57 +02:00 committed by zah
parent c3d6961eed
commit 7608fd76a3
1 changed files with 1 additions and 3 deletions

View File

@ -53,6 +53,4 @@ func hash*(x: Eth2Digest): Hash =
# We just slice the first 4 or 8 bytes of the block hash
# depending of if we are on a 32 or 64-bit platform
const size = x.sizeof
const num_hashes = size div sizeof(int)
result = cast[array[num_hashes, Hash]](x)[0]
result = cast[ptr Hash](unsafeAddr x)[]