]> granicus.if.org Git - php/commitdiff
Remove always-true comparisons
authorNikita Popov <nikic@php.net>
Mon, 15 Sep 2014 21:04:34 +0000 (23:04 +0200)
committerNikita Popov <nikic@php.net>
Mon, 15 Sep 2014 21:07:31 +0000 (23:07 +0200)
Zend/zend_hash.c

index 52ec43ba067fdeb6f9ff6ea847e782e43bff0e5f..5354ce29f63fba5d405ec837dcf724a246907241 100644 (file)
@@ -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;
                        }