From: Steinar H. Gunderson Date: Thu, 2 Mar 2006 14:21:51 +0000 (+0000) Subject: Be slighly more consistent about temporaries. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=bd5fbe451e860dc6d8c5b9eca1eb0919d050e465;p=hamming Be slighly more consistent about temporaries. --- diff --git a/hamming32.c b/hamming32.c index 6cbd153..fb53e3b 100644 --- a/hamming32.c +++ b/hamming32.c @@ -44,10 +44,8 @@ unsigned make_codeword(unsigned data) /* can detect all single or double bit errors */ int has_error(unsigned code) { - unsigned data = code >> PARITY_BITS; unsigned parity = code & ((1 << PARITY_BITS) - 1); - - return (generate_parity(data) != parity); + return (generate_parity(code >> PARITY_BITS) != parity); } int has_double_error(unsigned code)