]> granicus.if.org Git - php/commitdiff
MFB: little cleanup in json_determine_array_type()
authorNuno Lopes <nlopess@php.net>
Tue, 19 Dec 2006 15:01:57 +0000 (15:01 +0000)
committerNuno Lopes <nlopess@php.net>
Tue, 19 Dec 2006 15:01:57 +0000 (15:01 +0000)
ext/json/json.c

index 045ef35d1f68b046316c318829c691aa36c31f53..8aee1335f3fe71d92cd79dbb27fedf460c2a71b3 100644 (file)
@@ -84,14 +84,7 @@ static void json_escape_string(smart_str *buf, zstr s, int len, zend_uchar type)
 static int json_determine_array_type(zval **val TSRMLS_DC) /* {{{ */
 {
     int i;
-    HashTable *myht;
-
-    if (Z_TYPE_PP(val) == IS_ARRAY) {
-        myht = HASH_OF(*val);
-    } else {
-        myht = Z_OBJPROP_PP(val);
-        return 1;
-    }
+    HashTable *myht = HASH_OF(*val);
 
     i = myht ? zend_hash_num_elements(myht) : 0;
     if (i > 0) {