From 0d6378aa51f8dfb1f0b1c175a8f56223232d9f52 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 11 Nov 2021 16:32:08 -0800 Subject: delete a helper that hides stack side effects --- src/lua.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/lua.c b/src/lua.c index afee3a1..2b94349 100644 --- a/src/lua.c +++ b/src/lua.c @@ -309,15 +309,9 @@ static int handle_image (lua_State *L, char **argv, int n) { } -/* Push the string corresponding to the definition for 'name' on the stack. */ -void teliva_get_definition(lua_State *L, const char *name) { - lua_getglobal(L, "teliva_program"); - lua_getfield(L, -1, name); -} - - void write_definition_to_file(lua_State *L, char *name, char *outfilename) { - teliva_get_definition(L, name); + lua_getglobal(L, "teliva_program"); + lua_getfield(L, -1, name); const char *contents = lua_tostring(L, -1); lua_pop(L, 1); int outfd = open(outfilename, O_WRONLY|O_CREAT|O_TRUNC, 0644); -- cgit 1.4.1-2-gfad0