Re: nibtools, GCR, G64

From: Marko Mäkelä <msmakela_at_gmail.com>
Date: Fri, 31 May 2013 13:36:29 +0300
Message-ID: <20130531103629.GB4079@x220>
On Fri, May 31, 2013 at 12:18:03PM +0300, Marko Mäkelä wrote:
>If this is at least a 16-bit system, you could also assign the two 
>bytes to an integer, invert it and write code like this (I guess you 
>can keep the loop unrolled):
>
>unsigned mask = (1 << 10) - 1;
>
>if (!(b & mask)) break;
>mask <<= 1;
>if (!(b & mask)) break;
>...

I realized an even better way:

const unsigned mask = (1 << 10) - 1;

if (!(b & mask)) break;
b >>= 1;
if (!(b & mask)) break;
b >>= 1;
...

Best regards,

	Marko

       Message was sent through the cbm-hackers mailing list
Received on 2013-05-31 11:00:04

Archive generated by hypermail 2.2.0.