]> git.sesse.net Git - hamming/commitdiff
Be slighly more consistent about temporaries.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 2 Mar 2006 14:21:51 +0000 (14:21 +0000)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 2 Mar 2006 14:21:51 +0000 (14:21 +0000)
hamming32.c

index 6cbd153732d3516e9af67ca1a29e53cee0b4d6e4..fb53e3b2e9dfa48c0f908ba304092f56b44ccc9a 100644 (file)
@@ -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)