Skip to content

Commit 6e31350

Browse files
committed
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.
1 parent 4346d1b commit 6e31350

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

ext/standard/string.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1940,10 +1940,6 @@ PHP_FUNCTION(stripos)
19401940
RETURN_FALSE;
19411941
}
19421942

1943-
if (ZSTR_LEN(haystack) == 0) {
1944-
RETURN_FALSE;
1945-
}
1946-
19471943
if (ZSTR_LEN(needle) == 0 || ZSTR_LEN(needle) > ZSTR_LEN(haystack)) {
19481944
RETURN_FALSE;
19491945
}

0 commit comments

Comments
 (0)