]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: lua: Useless copy
authorThierry Fournier <tfournier@arpalert.org>
Fri, 19 Feb 2016 17:30:13 +0000 (18:30 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 23 Feb 2016 21:42:47 +0000 (22:42 +0100)
A value is copied two time in teh stack, but only one is usefull. The
second copy leaves unused in the stack and take some room for noting.

This path removes the second copy.

Must be backported in 1.6

src/hlua.c

index fe58b9d0b332d3a3eb0f211fcfe83353fc385411..ea800ee39801c8aa2996b65b9efcba1eaf917944 100644 (file)
@@ -7002,7 +7002,6 @@ void hlua_init(void)
 
        /* Register previous table in the registry with reference and named entry. */
        lua_pushvalue(gL.T, -1); /* Copy the -1 entry and push it on the stack. */
-       lua_pushvalue(gL.T, -1); /* Copy the -1 entry and push it on the stack. */
        lua_setfield(gL.T, LUA_REGISTRYINDEX, CLASS_SOCKET); /* register class socket. */
        class_socket_ref = luaL_ref(gL.T, LUA_REGISTRYINDEX); /* reference class socket. */