summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2018-09-19 13:54:37 +0300
committerDmitry Stogov <dmitry@zend.com>2018-09-19 13:54:37 +0300
commit2a54867f7eef9b5f12a3f084b24c4faaa0047836 (patch)
tree372970ffdc2c18a9cc79e9788c28317ab254b8d8
parent0df57480b6fb574580697da26df1ac5802bc367c (diff)
downloadphp-git-2a54867f7eef9b5f12a3f084b24c4faaa0047836.tar.gz
Micro-optimization
-rw-r--r--Zend/zend_inheritance.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c
index 7bf4cbcf12..401862b1f4 100644
--- a/Zend/zend_inheritance.c
+++ b/Zend/zend_inheritance.c
@@ -1451,8 +1451,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce, zend_class_e
/** Ensure that the preferred method is actually available. */
lcname = zend_string_tolower(cur_method_ref->method_name);
- method_exists = zend_hash_exists(&trait->function_table, lcname);
- if (!method_exists) {
+ if (!zend_hash_exists(&trait->function_table, lcname)) {
zend_error_noreturn(E_COMPILE_ERROR,
"A precedence rule was defined for %s::%s but this method does not exist",
ZSTR_VAL(trait->name),
@@ -1520,12 +1519,10 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce, zend_class_e
/** And, ensure that the referenced method is resolvable, too. */
lcname = zend_string_tolower(cur_method_ref->method_name);
- method_exists = zend_hash_exists(&trait->function_table, lcname);
- zend_string_release_ex(lcname, 0);
-
- if (!method_exists) {
+ if (!zend_hash_exists(&trait->function_table, lcname)) {
zend_error_noreturn(E_COMPILE_ERROR, "An alias was defined for %s::%s but this method does not exist", ZSTR_VAL(trait->name), ZSTR_VAL(cur_method_ref->method_name));
}
+ zend_string_release_ex(lcname, 0);
}
i++;
}