moonbridge
diff moonbridge_io.c @ 305:e4e1ad8d5ab8
Code cleanup in moonbr_io_read_cont function (avoid unnecessary lua_pushvalue)
author | jbe |
---|---|
date | Thu Nov 16 00:38:44 2017 +0100 (2017-11-16) |
parents | e18589f22314 |
children | 930a43a0099a |
line diff
1.1 --- a/moonbridge_io.c Thu Nov 16 00:36:55 2017 +0100 1.2 +++ b/moonbridge_io.c Thu Nov 16 00:38:44 2017 +0100 1.3 @@ -388,9 +388,7 @@ 1.4 lua_pushvalue(L, 2); 1.5 lua_callk(L, 0, 0, ctx, moonbr_io_read_cont); 1.6 } 1.7 - if (ctx == 1) { 1.8 - lua_pushvalue(L, 5); 1.9 - } else { 1.10 + if (ctx != 1) { 1.11 luaL_Buffer buf; 1.12 lua_Integer i, chunkcount; 1.13 chunkcount = lua_rawlen(L, 5); 1.14 @@ -400,8 +398,8 @@ 1.15 luaL_addvalue(&buf); 1.16 } 1.17 luaL_pushresult(&buf); 1.18 + lua_pushvalue(L, -2); 1.19 } 1.20 - lua_pushvalue(L, -2); 1.21 return 2; 1.22 } 1.23