com php-src: Remove always-true comparisons: Zend/zend_hash .c
| From: | Nikita Popov | Date: | Mon, 15 Sep 2014 21:07:31 +0000 |
| Subject: | com php-src: Remove always-true comparisons: Zend/zend_hash .c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81666@lists.php.net to get a copy of this message | ||
Commit: a7bfd006bd40354ac598d820becaceb6331c60c9
Author: Nikita Popov <nikic@php.net> Mon, 15 Sep 2014 23:04:34 +0200
Parents: ca43b99fc67bba123480d41507af57db9484a382
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a7bfd006bd40354ac598d820becaceb6331c60c9
Log:
Remove always-true comparisons
Changed paths:
M Zend/zend_hash.c
Diff:
diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c
index 52ec43b..5354ce2 100644
--- a/Zend/zend_hash.c
+++ b/Zend/zend_hash.c
@@ -856,7 +856,7 @@ ZEND_API int zend_hash_index_del(HashTable *ht, zend_ulong h)
IS_CONSISTENT(ht);
if (ht->u.flags & HASH_FLAG_PACKED) {
- if (h >=0 && h < ht->nNumUsed) {
+ if (h < ht->nNumUsed) {
p = ht->arData + h;
if (Z_TYPE(p->val) != IS_UNDEF) {
HANDLE_BLOCK_INTERRUPTIONS();
@@ -1455,7 +1455,7 @@ ZEND_API zval *zend_hash_index_find(const HashTable *ht, zend_ulong h)
IS_CONSISTENT(ht);
if (ht->u.flags & HASH_FLAG_PACKED) {
- if (h >= 0 && h < ht->nNumUsed) {
+ if (h < ht->nNumUsed) {
p = ht->arData + h;
if (Z_TYPE(p->val) != IS_UNDEF) {
return &p->val;
@@ -1476,7 +1476,7 @@ ZEND_API zend_bool zend_hash_index_exists(const HashTable *ht, zend_ulong h)
IS_CONSISTENT(ht);
if (ht->u.flags & HASH_FLAG_PACKED) {
- if (h >= 0 && h < ht->nNumUsed) {
+ if (h < ht->nNumUsed) {
if (Z_TYPE(ht->arData[h].val) != IS_UNDEF) {
return 1;
}