com php-src: Remove useless check in substr(): ext/standard/string.c

From: Date: Wed, 11 Nov 2015 22:13:57 +0000
Subject: com php-src: Remove useless check in substr(): ext/standard/string.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-89845@lists.php.net to get a copy of this message
Commit: c37890062d23093f844cceb4e6b619bb510eb793 Author: Thomas Punt <tpunt@hotmail.co.uk> Wed, 11 Nov 2015 22:13:57 +0000 Parents: d1077f7a897d9267a0cad3d64663fd952dd1c6b2 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c37890062d23093f844cceb4e6b619bb510eb793 Log: Remove useless check in substr() This check (if the start position is greater than the string length) is already performed on line 2399 Changed paths: M ext/standard/string.c Diff: diff --git a/ext/standard/string.c b/ext/standard/string.c index 3d5b76c..3922ff4 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -2426,10 +2426,6 @@ PHP_FUNCTION(substr) } } - if (f > (zend_long)ZSTR_LEN(str)) { - RETURN_FALSE; - } - if ((f + l) > (zend_long)ZSTR_LEN(str)) { l = ZSTR_LEN(str) - f; }

« previous php.cvs (#89845) next »