From: Nuno Lopes Date: Tue, 19 Dec 2006 15:01:57 +0000 (+0000) Subject: MFB: little cleanup in json_determine_array_type() X-Git-Tag: RELEASE_1_0_0RC1~640 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3945428c9fcd5acc0ba201449ad5b63ba431f740;p=php MFB: little cleanup in json_determine_array_type() --- diff --git a/ext/json/json.c b/ext/json/json.c index 045ef35d1f..8aee1335f3 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -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) {