Skip to content

Commit faec3b3

Browse files
committed
remove: variables and functions that are no longer needed
1 parent 0b6e4ef commit faec3b3

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

brotli.c

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
#include <Zend/zend_interfaces.h>
1616
#include "php_brotli.h"
1717

18-
int le_state;
19-
2018
# pragma GCC diagnostic ignored "-Wpointer-sign"
2119

2220
ZEND_DECLARE_MODULE_GLOBALS(brotli);
@@ -133,35 +131,6 @@ static int php_brotli_decoder_create(BrotliDecoderState **decoder)
133131
return SUCCESS;
134132
}
135133

136-
static php_brotli_state_context* php_brotli_state_init(void)
137-
{
138-
php_brotli_state_context *ctx
139-
= (php_brotli_state_context *)ecalloc(1,
140-
sizeof(php_brotli_state_context));
141-
ctx->encoder = NULL;
142-
ctx->decoder = NULL;
143-
return ctx;
144-
}
145-
146-
static void php_brotli_state_destroy(php_brotli_state_context *ctx)
147-
{
148-
if (ctx->encoder) {
149-
BrotliEncoderDestroyInstance(ctx->encoder);
150-
ctx->encoder = NULL;
151-
}
152-
if (ctx->decoder) {
153-
BrotliDecoderDestroyInstance(ctx->decoder);
154-
ctx->decoder = NULL;
155-
}
156-
efree(ctx);
157-
}
158-
159-
static void php_brotli_state_rsrc_dtor(zend_resource *res)
160-
{
161-
php_brotli_state_context *ctx = zend_fetch_resource(res, NULL, le_state);
162-
php_brotli_state_destroy(ctx);
163-
}
164-
165134
#define PHP_BROTLI_OUTPUT_HANDLER "ob_brotli_handler"
166135

167136
static int php_brotli_output_encoding(void)
@@ -1015,10 +984,6 @@ ZEND_MINIT_FUNCTION(brotli)
1015984
REGISTER_LONG_CONSTANT("BROTLI_FINISH", BROTLI_OPERATION_FINISH,
1016985
CONST_CS | CONST_PERSISTENT);
1017986

1018-
le_state = zend_register_list_destructors_ex(php_brotli_state_rsrc_dtor,
1019-
NULL, "brotli.state",
1020-
module_number);
1021-
1022987
php_output_handler_alias_register(ZEND_STRL(PHP_BROTLI_OUTPUT_HANDLER),
1023988
php_brotli_output_handler_init);
1024989
php_output_handler_conflict_register(ZEND_STRL(PHP_BROTLI_OUTPUT_HANDLER),

0 commit comments

Comments
 (0)