1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 19:23:22 +02:00

Remove unnecessary haystack length check in stripos()

This falls out naturally from the following condition, because
either the needle length will be zero as well, or the needle
will be longer than the (empty) haystack.
This commit is contained in:
Nikita Popov
2019-08-25 16:31:15 +02:00
parent 4346d1b0e6
commit 6e3135070c
-4
View File
@@ -1940,10 +1940,6 @@ PHP_FUNCTION(stripos)
RETURN_FALSE;
}
if (ZSTR_LEN(haystack) == 0) {
RETURN_FALSE;
}
if (ZSTR_LEN(needle) == 0 || ZSTR_LEN(needle) > ZSTR_LEN(haystack)) {
RETURN_FALSE;
}