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.
diff --git a/src/hlua.c b/src/hlua.c
index 6ce18e1..643d3fc 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -3309,8 +3309,7 @@
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 @@
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 @@
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. */