[BusyBox] Today's ash improvements

Sven Oliver Moll svolli at svolli.de
Fri Aug 3 12:05:51 UTC 2001


On Fri, 3 Aug 2001, David Edwards wrote:

> On Fri, Aug 03, 2001 at 01:50:24PM -0400, David Edwards wrote:
> > On Fri, Aug 03, 2001 at 09:54:07AM -0700, Aaron Lehmann wrote:
> > > This patch contains three distinct size optimizations:
> > >
> > > 1) is_digit() uses only one comparison now. ((c)>='0' && (c)<='9') was
> > > replaced with ((unsigned)(c) - '0' <= 9). Neat trick, eh?
> >
> > What about when c has an ascii value less than 0x30, like SPACE,!,",#,etc ?
> > It seems that those characters will be classified as digits.
> >
> Whoops, I didn't think hard enough about the unsigned typecast. Sorry.
But ((unsigned)(c - '0') <= 9) should do the trick.

Greetings from Germany,
SvOlli
-- 
  _______
 (  /\           | No swords. No spells. Pistols, rockets, submachine guns,
__)v\/lli a.k.a. | laser weapons, and cunning are all the magic you need.
Sven Oliver Moll |   -- Package of Wasteland by Interplay (C64 Version)






More information about the busybox mailing list