Re: Radiobuttons dont work?



"Robert Wilkens" <RobertWilkens msn com> writes: 
> Please consider taking the 'if i==1' thing out of the loop... Do your initialization
> before you enter the loop, then make the loop 'for i = 2 to 5' instead of 1 to 5.  The
> way your code is written it's not only doing an unnecessary compare, it's not only less
> readable, but it's also doing that unnecessary compare with a branch *four* times in
> the loop.  X-windows is slow enough without bad code making it worse. 
> 

The i == 1 there is so completely irrelevant to any real-world
performance consideration it's not even funny. Worrying about it for
that reason would be nuts.

Only code readability should be considered here.

Havoc





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]