mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-20 22:01:49 -04:00
CLEANUP: lua: remove test
The man of "luaL_unref" says "If ref is LUA_NOREF or LUA_REFNIL, luaL_unref does nothing.", so I remove the check.
This commit is contained in:
parent
f326767711
commit
e068b60605
1 changed files with 3 additions and 6 deletions
|
|
@ -3309,8 +3309,7 @@ __LJMP static int hlua_applet_tcp_set_priv(lua_State *L)
|
|||
MAY_LJMP(check_args(L, 2, "set_priv"));
|
||||
|
||||
/* Remove previous value. */
|
||||
if (hlua->Mref != -1)
|
||||
luaL_unref(L, LUA_REGISTRYINDEX, hlua->Mref);
|
||||
luaL_unref(L, LUA_REGISTRYINDEX, hlua->Mref);
|
||||
|
||||
/* Get and store new value. */
|
||||
lua_pushvalue(L, 2); /* Copy the element 2 at the top of the stack. */
|
||||
|
|
@ -3772,8 +3771,7 @@ __LJMP static int hlua_applet_http_set_priv(lua_State *L)
|
|||
MAY_LJMP(check_args(L, 2, "set_priv"));
|
||||
|
||||
/* Remove previous value. */
|
||||
if (hlua->Mref != -1)
|
||||
luaL_unref(L, LUA_REGISTRYINDEX, hlua->Mref);
|
||||
luaL_unref(L, LUA_REGISTRYINDEX, hlua->Mref);
|
||||
|
||||
/* Get and store new value. */
|
||||
lua_pushvalue(L, 2); /* Copy the element 2 at the top of the stack. */
|
||||
|
|
@ -4859,8 +4857,7 @@ __LJMP static int hlua_set_priv(lua_State *L)
|
|||
hlua = hlua_gethlua(L);
|
||||
|
||||
/* Remove previous value. */
|
||||
if (hlua->Mref != -1)
|
||||
luaL_unref(L, LUA_REGISTRYINDEX, hlua->Mref);
|
||||
luaL_unref(L, LUA_REGISTRYINDEX, hlua->Mref);
|
||||
|
||||
/* Get and store new value. */
|
||||
lua_pushvalue(L, 2); /* Copy the element 2 at the top of the stack. */
|
||||
|
|
|
|||
Loading…
Reference in a new issue