summaryrefslogtreecommitdiff
path: root/Zend/zend_API.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-04-28 19:11:45 +0300
committerDmitry Stogov <dmitry@zend.com>2015-04-28 19:11:45 +0300
commit388c2cbdbc5a4d24a2ff52402212117348c085b4 (patch)
treed582999a8d0c89277072ed06a46424bc4829529e /Zend/zend_API.c
parent612de5214ff0b1db89516fc970984a350b065b2b (diff)
downloadphp-git-388c2cbdbc5a4d24a2ff52402212117348c085b4.tar.gz
Micro optimizations
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r--Zend/zend_API.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index f028756a93..e55ec45af6 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -1223,16 +1223,20 @@ ZEND_API int zend_update_class_constants(zend_class_entry *class_type) /* {{{ */
ZEND_API void object_properties_init(zend_object *object, zend_class_entry *class_type) /* {{{ */
{
- int i;
-
if (class_type->default_properties_count) {
- for (i = 0; i < class_type->default_properties_count; i++) {
+ zval *src = class_type->default_properties_table;
+ zval *dst = object->properties_table;
+ zval *end = src + class_type->default_properties_count;
+
+ do {
#if ZTS
- ZVAL_DUP(&object->properties_table[i], &class_type->default_properties_table[i]);
+ ZVAL_DUP(dst, src);
#else
- ZVAL_COPY(&object->properties_table[i], &class_type->default_properties_table[i]);
+ ZVAL_COPY(dst, src);
#endif
- }
+ src++;
+ dst++;
+ } while (src != end);
object->properties = NULL;
}
}
@@ -3451,10 +3455,12 @@ ZEND_API int zend_fcall_info_init(zval *callable, uint check_flags, zend_fcall_i
ZEND_API void zend_fcall_info_args_clear(zend_fcall_info *fci, int free_mem) /* {{{ */
{
if (fci->params) {
- uint32_t i;
+ zval *p = fci->params;
+ zval *end = p + fci->param_count;
- for (i = 0; i < fci->param_count; i++) {
- zval_ptr_dtor(&fci->params[i]);
+ while (p != end) {
+ i_zval_ptr_dtor(p ZEND_FILE_LINE_CC);
+ p++;
}
if (free_mem) {
efree(fci->params);