summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2014-12-21 23:16:25 -0500
committerXinchen Hui <laruence@php.net>2014-12-21 23:16:25 -0500
commitc24125e2f90e7cc88c8a2c3560bc458dbc8b704d (patch)
treeff9486e671818f4a401acfeafab1b93537375d75 /ext
parent201e1b8a8d22b244b4e22d239db55ea85ccc6983 (diff)
downloadphp-git-c24125e2f90e7cc88c8a2c3560bc458dbc8b704d.tar.gz
Micro optimization
Diffstat (limited to 'ext')
-rw-r--r--ext/spl/spl_array.c4
-rw-r--r--ext/standard/basic_functions.c10
2 files changed, 4 insertions, 10 deletions
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index 4f6efcac7d..57ba65bf8e 100644
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -949,15 +949,13 @@ static int spl_array_compare_objects(zval *o1, zval *o2) /* {{{ */
spl_array_object *intern1,
*intern2;
int result = 0;
- zval temp_zv;
intern1 = Z_SPLARRAY_P(o1);
intern2 = Z_SPLARRAY_P(o2);
ht1 = spl_array_get_hash_table(intern1, 0);
ht2 = spl_array_get_hash_table(intern2, 0);
- zend_compare_symbol_tables(&temp_zv, ht1, ht2);
- result = (int)Z_LVAL(temp_zv);
+ result = zend_compare_symbol_tables(ht1, ht2);
/* if we just compared std.properties, don't do it again */
if (result == 0 &&
!(ht1 == intern1->std.properties && ht2 == intern2->std.properties)) {
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index cef9c6d967..ed5206aa69 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -4937,15 +4937,11 @@ static int user_tick_function_compare(user_tick_function_entry * tick_fe1, user_
int ret;
if (Z_TYPE_P(func1) == IS_STRING && Z_TYPE_P(func2) == IS_STRING) {
- ret = (zend_binary_zval_strcmp(func1, func2) == 0);
+ ret = zend_binary_zval_strcmp(func1, func2) == 0;
} else if (Z_TYPE_P(func1) == IS_ARRAY && Z_TYPE_P(func2) == IS_ARRAY) {
- zval result;
- zend_compare_arrays(&result, func1, func2);
- ret = (Z_LVAL(result) == 0);
+ ret = zend_compare_arrays(func1, func2) == 0;
} else if (Z_TYPE_P(func1) == IS_OBJECT && Z_TYPE_P(func2) == IS_OBJECT) {
- zval result;
- zend_compare_objects(&result, func1, func2);
- ret = (Z_LVAL(result) == 0);
+ ret = zend_compare_objects(func1, func2) == 0;
} else {
ret = 0;
}