From d6554919b1e2e5f598e7997297a358905ee54913 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Wed, 16 Mar 2022 21:28:58 -0700 Subject: delete dead code --- src/teliva.c | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'src') diff --git a/src/teliva.c b/src/teliva.c index 3d20267..dbd0677 100644 --- a/src/teliva.c +++ b/src/teliva.c @@ -298,31 +298,6 @@ void assign_call_graph_depth_to_name(lua_State* L, int depth, const char* name) lua_pop(L, 1); // table } -int array_contains_string(lua_State* L, int array_index, const char* s) { - int oldtop = lua_gettop(L); - assert(lua_istable(L, array_index)); - int array_size = luaL_getn(L, array_index); - int result = false; - for (int i = 1; i <= array_size; ++i) { - lua_rawgeti(L, array_index, i); - assert(lua_isstring(L, -1)); - const char* curr = lua_tostring(L, -1); - result = result || (strcmp(curr, s) == 0); - lua_pop(L, 1); // current element - if (result) break; - } - assert(oldtop == lua_gettop(L)); - return result; -} - -void append_string_to_array(lua_State* L, int array_index, const char* s) { - assert(lua_istable(L, array_index)); - int array_size = luaL_getn(L, array_index); - int new_index = array_size+1; - lua_pushstring(L, s); - lua_rawseti(L, array_index, new_index); -} - static void save_caller_as(lua_State* L, const char* name, const char* caller_name) { // push table of caller tables luaL_newmetatable(L, "__teliva_caller"); -- cgit 1.4.1-2-gfad0