Skip to content

Commit a024673

Browse files
committed
optimize: header_filter_by_lua*: removed a piece of useless code. thanks Zi Lin for the report.
1 parent 23c2cea commit a024673

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

src/ngx_http_lua_headerfilterby.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@
2828
static ngx_http_output_header_filter_pt ngx_http_next_header_filter;
2929

3030

31-
/* light user data key for the "ngx" table in the Lua VM regsitry */
32-
static char ngx_http_lua_headerfilterby_ngx_key;
33-
34-
3531
/**
3632
* Set environment table for the given code closure.
3733
*
@@ -64,12 +60,6 @@ ngx_http_lua_header_filter_by_lua_env(lua_State *L, ngx_http_request_t *r)
6460
* */
6561
ngx_http_lua_create_new_globals_table(L, 0 /* narr */, 1 /* nrec */);
6662

67-
/* {{{ initialize ngx.* namespace */
68-
lua_pushlightuserdata(L, &ngx_http_lua_headerfilterby_ngx_key);
69-
lua_rawget(L, LUA_REGISTRYINDEX);
70-
lua_setfield(L, -2, "ngx");
71-
/* }}} */
72-
7363
/* {{{ make new env inheriting main thread's globals table */
7464
lua_createtable(L, 0, 1 /* nrec */); /* the metatable for the new env */
7565
ngx_http_lua_get_globals_table(L);

0 commit comments

Comments
 (0)