This commit is contained in:
CismonX 2019-06-12 11:20:37 +08:00
parent 5f3f4f1d96
commit da855f8844
2 changed files with 7 additions and 6 deletions

3
.gitattributes vendored
View File

@ -1 +1,2 @@
*.h linguist-language=C *.h linguist-language=C
stubs/* linguist-documentation

View File

@ -21,7 +21,7 @@
#define CMP_G COLLECTIONS_G(cmp) #define CMP_G COLLECTIONS_G(cmp)
#define Z_COLLECTION_P(val) (Z_OBJ_P(val)->properties) #define Z_COLLECTION_P(val) (Z_OBJ_P(val)->properties)
#define THIS_COLLECTION Z_COLLECTION_P(getThis()) #define THIS_COLLECTION Z_COLLECTION_P(&EX(This))
#define PAIR_FIRST(obj) OBJ_PROP_NUM(obj, 0) #define PAIR_FIRST(obj) OBJ_PROP_NUM(obj, 0)
#define PAIR_SECOND(obj) OBJ_PROP_NUM(obj, 1) #define PAIR_SECOND(obj) OBJ_PROP_NUM(obj, 1)
@ -36,7 +36,7 @@
ht = Z_OBJ_P(obj)->properties = zend_array_dup(ht); \ ht = Z_OBJ_P(obj)->properties = zend_array_dup(ht); \
} }
#define SEPARATE_CURRENT_COLLECTION(ht) \ #define SEPARATE_CURRENT_COLLECTION(ht) \
SEPARATE_COLLECTION(ht, getThis()) SEPARATE_COLLECTION(ht, &EX(This))
#define INIT_FCI(fci, num_args) \ #define INIT_FCI(fci, num_args) \
zval params[num_args], retval; \ zval params[num_args], retval; \
@ -1270,7 +1270,7 @@ PHP_METHOD(Collection, copyOfRange)
PHP_METHOD(Collection, count) PHP_METHOD(Collection, count)
{ {
zend_long count; zend_long count;
collection_count_elements(getThis(), &count); collection_count_elements(&EX(This), &count);
RETVAL_LONG(count); RETVAL_LONG(count);
} }
@ -2324,7 +2324,7 @@ PHP_METHOD(Collection, onEach)
CALLBACK_KEYVAL_INVOKE(params, bucket); CALLBACK_KEYVAL_INVOKE(params, bucket);
zval_ptr_dtor(&retval); zval_ptr_dtor(&retval);
ZEND_HASH_FOREACH_END(); ZEND_HASH_FOREACH_END();
RETVAL_ZVAL(getThis(), 1, 0); RETVAL_ZVAL(&EX(This), 1, 0);
} }
PHP_METHOD(Collection, partition) PHP_METHOD(Collection, partition)
@ -3422,7 +3422,7 @@ PHP_METHOD(Pair, __construct)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
Z_TRY_ADDREF_P(first); Z_TRY_ADDREF_P(first);
Z_TRY_ADDREF_P(second); Z_TRY_ADDREF_P(second);
zend_object* current = Z_OBJ_P(getThis()); zend_object* current = Z_OBJ_P(&EX(This));
pair_update_first(current, first); pair_update_first(current, first);
pair_update_second(current, second); pair_update_second(current, second);
} }