about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-11-11 16:32:08 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-11-11 16:32:08 -0800
commit0d6378aa51f8dfb1f0b1c175a8f56223232d9f52 (patch)
tree480ecc52e2a6b295eb5905cfd6416d3ed9ee2a13
parent7b389ce41efa4f28687d418a84063907bc66380a (diff)
downloadteliva-0d6378aa51f8dfb1f0b1c175a8f56223232d9f52.tar.gz
delete a helper that hides stack side effects
-rw-r--r--src/lua.c10
1 files changed, 2 insertions, 8 deletions
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);