Only call strlen(lc_fname) if we are going to use the result

This commit is contained in:
Olly Betts 2014-02-17 16:24:04 +13:00
commit 052d0057c2

View file

@ -102,12 +102,11 @@ namespace Swig {
TSRMLS_FETCH_FROM_CTX(swig_zts_ctx);
zend_class_entry **ce;
zend_function *mptr;
int name_len = strlen(lc_fname);
if (zend_lookup_class(cname, strlen(cname), &ce TSRMLS_CC) != SUCCESS) {
return false;
}
if (zend_hash_find(&(*ce)->function_table, lc_fname, name_len + 1, (void **) &mptr) != SUCCESS) {
if (zend_hash_find(&(*ce)->function_table, lc_fname, strlen(lc_fname) + 1, (void **) &mptr) != SUCCESS) {
return false;
}
// common.scope points to the declaring class