} /* }}} */
-static int spl_object_storage_get_hash(zend_hash_key *key, spl_SplObjectStorage *intern, zend_object *this, zval *obj) {
+static int spl_object_storage_get_hash(zend_hash_key *key, spl_SplObjectStorage *intern, zval *obj) {
if (intern->fptr_get_hash) {
zval rv;
- zend_call_method_with_1_params(this, intern->std.ce, &intern->fptr_get_hash, "getHash", &rv, obj);
+ zend_call_method_with_1_params(
+ &intern->std, intern->std.ce, &intern->fptr_get_hash, "getHash", &rv, obj);
if (!Z_ISUNDEF(rv)) {
if (Z_TYPE(rv) == IS_STRING) {
key->key = Z_STR(rv);
}
} /* }}} */
-spl_SplObjectStorageElement *spl_object_storage_attach(spl_SplObjectStorage *intern, zend_object *this, zval *obj, zval *inf) /* {{{ */
+spl_SplObjectStorageElement *spl_object_storage_attach(spl_SplObjectStorage *intern, zval *obj, zval *inf) /* {{{ */
{
spl_SplObjectStorageElement *pelement, element;
zend_hash_key key;
- if (spl_object_storage_get_hash(&key, intern, this, obj) == FAILURE) {
+ if (spl_object_storage_get_hash(&key, intern, obj) == FAILURE) {
return NULL;
}
return pelement;
} /* }}} */
-static int spl_object_storage_detach(spl_SplObjectStorage *intern, zval *this, zval *obj) /* {{{ */
+static int spl_object_storage_detach(spl_SplObjectStorage *intern, zval *obj) /* {{{ */
{
int ret = FAILURE;
zend_hash_key key;
- if (spl_object_storage_get_hash(&key, intern, Z_OBJ_P(this), obj) == FAILURE) {
+ if (spl_object_storage_get_hash(&key, intern, obj) == FAILURE) {
return ret;
}
if (key.key) {
return ret;
} /* }}}*/
-void spl_object_storage_addall(spl_SplObjectStorage *intern, zend_object *this, spl_SplObjectStorage *other) { /* {{{ */
+void spl_object_storage_addall(spl_SplObjectStorage *intern, spl_SplObjectStorage *other) { /* {{{ */
spl_SplObjectStorageElement *element;
ZEND_HASH_FOREACH_PTR(&other->storage, element) {
- spl_object_storage_attach(intern, this, &element->obj, &element->inf);
+ spl_object_storage_attach(intern, &element->obj, &element->inf);
} ZEND_HASH_FOREACH_END();
intern->index = 0;
if (orig) {
spl_SplObjectStorage *other = spl_object_storage_from_obj(orig);
- spl_object_storage_addall(intern, orig, other);
+ spl_object_storage_addall(intern, other);
}
return &intern->std;
}
/* }}} */
-int spl_object_storage_contains(spl_SplObjectStorage *intern, zval *this, zval *obj) /* {{{ */
+int spl_object_storage_contains(spl_SplObjectStorage *intern, zval *obj) /* {{{ */
{
int found;
zend_hash_key key;
- if (spl_object_storage_get_hash(&key, intern, Z_OBJ_P(this), obj) == FAILURE) {
+ if (spl_object_storage_get_hash(&key, intern, obj) == FAILURE) {
return 0;
}
if (zend_parse_parameters(ZEND_NUM_ARGS(), "o|z!", &obj, &inf) == FAILURE) {
return;
}
- spl_object_storage_attach(intern, Z_OBJ_P(ZEND_THIS), obj, inf);
+ spl_object_storage_attach(intern, obj, inf);
} /* }}} */
/* {{{ proto void SplObjectStorage::detach(object obj)
if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
return;
}
- spl_object_storage_detach(intern, ZEND_THIS, obj);
+ spl_object_storage_detach(intern, obj);
zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos);
intern->index = 0;
return;
}
- if (spl_object_storage_get_hash(&key, intern, Z_OBJ_P(ZEND_THIS), obj) == FAILURE) {
+ if (spl_object_storage_get_hash(&key, intern, obj) == FAILURE) {
return;
}
other = Z_SPLOBJSTORAGE_P(obj);
- spl_object_storage_addall(intern, Z_OBJ_P(ZEND_THIS), other);
+ spl_object_storage_addall(intern, other);
RETURN_LONG(zend_hash_num_elements(&intern->storage));
} /* }}} */
zend_hash_internal_pointer_reset(&other->storage);
while ((element = zend_hash_get_current_data_ptr(&other->storage)) != NULL) {
- if (spl_object_storage_detach(intern, ZEND_THIS, &element->obj) == FAILURE) {
+ if (spl_object_storage_detach(intern, &element->obj) == FAILURE) {
zend_hash_move_forward(&other->storage);
}
}
other = Z_SPLOBJSTORAGE_P(obj);
ZEND_HASH_FOREACH_PTR(&intern->storage, element) {
- if (!spl_object_storage_contains(other, ZEND_THIS, &element->obj)) {
- spl_object_storage_detach(intern, ZEND_THIS, &element->obj);
+ if (!spl_object_storage_contains(other, &element->obj)) {
+ spl_object_storage_detach(intern, &element->obj);
}
} ZEND_HASH_FOREACH_END();
if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
return;
}
- RETURN_BOOL(spl_object_storage_contains(intern, ZEND_THIS, obj));
+ RETURN_BOOL(spl_object_storage_contains(intern, obj));
} /* }}} */
/* {{{ proto int SplObjectStorage::count()
goto outexcept;
}
- if (spl_object_storage_get_hash(&key, intern, Z_OBJ_P(ZEND_THIS), &entry) == FAILURE) {
+ if (spl_object_storage_get_hash(&key, intern, &entry) == FAILURE) {
zval_ptr_dtor(&entry);
zval_ptr_dtor(&inf);
goto outexcept;
var_push_dtor(&var_hash, &pelement->obj);
}
}
- element = spl_object_storage_attach(intern, Z_OBJ_P(ZEND_THIS), &entry, Z_ISUNDEF(inf)?NULL:&inf);
+ element = spl_object_storage_attach(intern, &entry, Z_ISUNDEF(inf)?NULL:&inf);
var_replace(&var_hash, &entry, &element->obj);
var_replace(&var_hash, &inf, &element->inf);
zval_ptr_dtor(&entry);
return;
}
- spl_object_storage_attach(intern, &intern->std, key, val);
+ spl_object_storage_attach(intern, key, val);
key = NULL;
} else {
key = val;
}
}
- spl_object_storage_attach(intern, Z_OBJ_P(ZEND_THIS), iterator, info);
+ spl_object_storage_attach(intern, iterator, info);
}
/* }}} */