From bb4d3e2b71711246270591042b244d4865f0cd17 Mon Sep 17 00:00:00 2001 From: Alberto Restifo Date: Sun, 3 May 2020 13:43:23 +0200 Subject: [PATCH] Remove duplicated bit shift --- src/cbor/type/float_16.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cbor/type/float_16.cr b/src/cbor/type/float_16.cr index f81e26d..a999ce0 100644 --- a/src/cbor/type/float_16.cr +++ b/src/cbor/type/float_16.cr @@ -10,7 +10,7 @@ def Float32.new(i : UInt16) half_man = (i & 0x03FF).to_u32 # Check for an infinity or NaN when all exponent bits set - if (i & 0x7C00) == 0x7C00 + if half_exp == 0x7C00 # Check for signed infinity if mantissa is zero if half_man == 0 return ((half_sign << 16) | 0x7F80_0000).unsafe_as(Float32)