mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
Optimisation for zend_memnstr when the needle is only a single character. (Patch by Michal Dziemianko - GSoC08)
This commit is contained in:
parent
86a493f435
commit
e19f52047c
@ -220,6 +220,10 @@ zend_memnstr(char *haystack, char *needle, int needle_len, char *end)
|
||||
char *p = haystack;
|
||||
char ne = needle[needle_len-1];
|
||||
|
||||
if (needle_len == 1) {
|
||||
return (char *)memchr(p, *needle, (end-p));
|
||||
}
|
||||
|
||||
end -= needle_len;
|
||||
|
||||
while (p <= end) {
|
||||
|
Loading…
Reference in New Issue
Block a user