From 07fed9053a476b4c6e5ecd23fc43ec84f4094978 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Sat, 13 Oct 2018 13:35:01 -0400 Subject: lua optimize current_path function frees up around 500 bytes by using the builtin string functionality Change-Id: Icd4ec921d3fec339b8a4b7f80c9c63d51d4c101c --- apps/plugins/lua/rocklib.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'apps/plugins/lua/rocklib.c') diff --git a/apps/plugins/lua/rocklib.c b/apps/plugins/lua/rocklib.c index 57165a5d15..ffd449e9d4 100644 --- a/apps/plugins/lua/rocklib.c +++ b/apps/plugins/lua/rocklib.c @@ -194,13 +194,7 @@ RB_WRAP(font_getstringsize) RB_WRAP(current_path) { - const char *current_path = get_current_path(L, 1); - if(current_path != NULL) - lua_pushstring(L, current_path); - else - lua_pushnil(L); - - return 1; + return get_current_path(L, 1); } static void fill_text_message(lua_State *L, struct text_message * message, -- cgit v1.2.3