mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
Optimisation for zend_memnstr when the needle is only a single character. (Patch by Michal Dziemianko - GSoC08)
This commit is contained in:
parent
b0a4aa7e3b
commit
e6848d51c2
@ -231,6 +231,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