Skip to content

Commit 1fb430b

Browse files
committed
fix: simplify output handler context start by removing intermediate variable and adding compression coding check
1 parent b480694 commit 1fb430b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

zstd.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,12 +1320,11 @@ static zend_result php_zstd_output_handler_context_start(php_zstd_context *ctx)
13201320
}
13211321

13221322
zend_string *dict = php_zstd_output_handler_load_dict(ctx);
1323-
1324-
if (php_zstd_context_create_compress(ctx, level, dict) != SUCCESS) {
1323+
if (!PHP_ZSTD_G(compression_coding)) {
13251324
return FAILURE;
13261325
}
13271326

1328-
return SUCCESS;
1327+
return php_zstd_context_create_compress(ctx, level, dict);
13291328
}
13301329

13311330
static void php_zstd_output_handler_context_dtor(void *opaq)

0 commit comments

Comments
 (0)