Skip to content

Commit

Permalink
Avoid getThis() usages in zip extension
Browse files Browse the repository at this point in the history
There isn't any magic going on here, we can just use ZEND_THIS
and assume it exists.
  • Loading branch information
nikic committed Aug 6, 2020
1 parent ab36540 commit 84a080e
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions ext/zip/php_zip.c
Original file line number Diff line number Diff line change
Expand Up @@ -2884,15 +2884,11 @@ static void _php_zip_progress_callback(zip_t *arch, double state, void *ptr)
PHP_METHOD(ZipArchive, registerProgressCallback)
{
struct zip *intern;
zval *self = getThis();
zval *self = ZEND_THIS;
double rate;
zval *callback;
ze_zip_object *obj;

if (!self) {
RETURN_FALSE;
}

if (zend_parse_parameters(ZEND_NUM_ARGS(), "dz", &rate, &callback) == FAILURE) {
return;
}
Expand Down Expand Up @@ -2942,14 +2938,10 @@ static int _php_zip_cancel_callback(zip_t *arch, void *ptr)
PHP_METHOD(ZipArchive, registerCancelCallback)
{
struct zip *intern;
zval *self = getThis();
zval *self = ZEND_THIS;
zval *callback;
ze_zip_object *obj;

if (!self) {
RETURN_FALSE;
}

if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &callback) == FAILURE) {
return;
}
Expand Down

0 comments on commit 84a080e

Please sign in to comment.