Permalink
Browse files

avoid copying zvals

.. and make reading from *_TO_MIXED arrays even more faster
  • Loading branch information...
tony2001 committed Mar 26, 2013
1 parent 47cf7e3 commit 1f4f71115ce47ffe8f95c433fc8db8af4ee3fac0
Showing with 4 additions and 5 deletions.
  1. +4 −5 php_judy.c
View
@@ -178,14 +178,13 @@ zval *judy_object_read_dimension_helper(zval *object, zval *offset TSRMLS_DC) /*
}
if (PValue != NULL && PValue != PJERR) {
- MAKE_STD_ZVAL(result);
- Z_SET_REFCOUNT_P(result, 0);
- Z_UNSET_ISREF_P(result);
-
if (intern->type == TYPE_INT_TO_INT || intern->type == TYPE_STRING_TO_INT) {
+ MAKE_STD_ZVAL(result);
+ Z_SET_REFCOUNT_P(result, 0);
+ Z_UNSET_ISREF_P(result);
ZVAL_LONG(result, (long)*PValue);
} else if (intern->type == TYPE_INT_TO_MIXED || intern->type == TYPE_STRING_TO_MIXED) {
- ZVAL_ZVAL(result, *(zval **)PValue, 1, 0);
+ result = (zval *)*PValue;
}
if (pstring_key != offset) {
zval_dtor(pstring_key);

0 comments on commit 1f4f711

Please sign in to comment.