On Tue, Jan 18, 2005 at 05:42:34PM -0700, Kevin P. Fleming wrote:
> Finally, it's silly to use strlen at all here for the first check, 
> that's why we have ast_strlen_zero, which checks only the first 
> character of the string to see whether it's null or not... however, that 
> depends on how often the string being checked here will be non-empty; if 
> it will be empty a great deal of the time, ast_strlen_zero will be a big 
> CPU time savings. If on the other hand it will be non-empty most of the 
> time, calling strlen will be OK, since we need that value anyway.

Any C programmer who checks with strlen() if the length of a string
is greater than zero should be forced to read the K&R book again
to understand how the C programming language actually works.

Edwin

-- 
Edwin Groothuis      |            Personal website: http://www.mavetju.org
[EMAIL PROTECTED]    |          Weblog: http://weblog.barnet.com.au/edwin/
_______________________________________________
Asterisk-Dev mailing list
[email protected]
http://lists.digium.com/mailman/listinfo/asterisk-dev
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

Reply via email to