Re: Unnecessary if statement? Programming technique

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

 



Jared Williams wrote:
> Why not
> 
> for ($i = 0; $i < 1000000/100; ++$i)

This involves dividing 1000000 by 100 for each iteration of the loop.
It would be better to test against 10000.

There is also the unwanted side-effect of executing the code on each
hundredth iteration, which is unwanted (as far as I understand the
problem). :)

It would be interesting if Steve could divulge the greater problem that
he is seeking a solution to.

Cheers,

David
-- 
David Grant
http://www.grant.org.uk/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux