com php-src: Remove unnecessary boundary checks: ext/standard/array.c
| From: | Anatol Belski | Date: | Mon, 16 May 2016 17:15:40 +0000 |
| Subject: | com php-src: Remove unnecessary boundary checks: ext/standard/array.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-92150@lists.php.net to get a copy of this message | ||
Commit: 367fde99475c1a79dc84c2fcf64c463ec633ad8e
Author: Thomas Punt <tpunt@hotmail.co.uk> Sat, 16 Apr 2016 09:33:01 +0100
Committer: Anatol Belski <ab@php.net> Mon, 16 May 2016 19:15:40 +0200
Parents: 39052d4d750ee0b7e56fd39edecd860b1a37ac57
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=367fde99475c1a79dc84c2fcf64c463ec633ad8e
Log:
Remove unnecessary boundary checks
Changed paths:
M ext/standard/array.c
Diff:
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 0800ac0..82b1d5a 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -2237,7 +2237,7 @@ double_str:
RANGE_CHECK_DOUBLE_INIT_ARRAY(low, high);
ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(return_value)) {
- for (i = 0; i < size && (element = low - (i * step)) <= low && element
>= high; ++i) {
+ for (i = 0; i < size && (element = low - (i * step)) >= high; ++i) {
Z_DVAL(tmp) = element;
ZEND_HASH_FILL_ADD(&tmp);
}
@@ -2251,7 +2251,7 @@ double_str:
RANGE_CHECK_DOUBLE_INIT_ARRAY(high, low);
ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(return_value)) {
- for (i = 0; i < size && (element = low + (i * step)) <= high && element
>= low; ++i) {
+ for (i = 0; i < size && (element = low + (i * step)) <= high; ++i) {
Z_DVAL(tmp) = element;
ZEND_HASH_FILL_ADD(&tmp);
}