Re: cvs: php4 /ext/standard var.c
| From: | Zeev Suraski | Date: | Thu, 29 Jun 2000 15:50:54 +0000 |
| Subject: | Re: cvs: php4 /ext/standard var.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-553@lists.php.net to get a copy of this message | ||
On Thu, 29 Jun 2000, Stanislav Malyshev wrote:
> AZ>> Why not use zend_str_tolower()?
>
> Because this is faster. calling memcpy and then strtolower makes two
> passes on the string, while this one makes one pass. It could be optimized
> too, I believe (by using potinters instead of indexes), so if anybody
> wants to, please do it.
zend_str_tolower() doesn't call memcmp(), it replaces the characters
in-place. Since it does use pointers, it's in fact faster than your code.
Zeev
--
Zeev Suraski <zeev@zend.com>
http://www.zend.com/