about summary refs log tree commit diff stats
path: root/src/lcurseslib.c
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-11-07 06:30:11 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-11-07 06:30:15 -0800
commit40fdaf2a2a071e1716adaba13cab2eee9854f67d (patch)
tree90e582949371093c8ccf9a2bd1887dcb6bd9bf27 /src/lcurseslib.c
parent51d6ae77d28b4a90019f448d14a62a77f7e820cc (diff)
downloadteliva-40fdaf2a2a071e1716adaba13cab2eee9854f67d.tar.gz
more obvious phrasing
Early returns are only worthwhile if they're utterly obvious.
Diffstat (limited to 'src/lcurseslib.c')
-rw-r--r--src/lcurseslib.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/lcurseslib.c b/src/lcurseslib.c
index a73bca8..be99512 100644
--- a/src/lcurseslib.c
+++ b/src/lcurseslib.c
@@ -47,14 +47,11 @@ void draw_menu (lua_State *L) {
   /* render any app-specific items */
   lua_getglobal(L, "menu");
   int table = lua_gettop(L);
-  if (!lua_istable(L, -1)) {
-    lua_pop(L, 1);
-    attroff(A_BOLD);
-    return;
-  }
-  for (lua_pushnil(L); lua_next(L, table) != 0; lua_pop(L, 1))
-    draw_menu_item(lua_tostring(L, -2), lua_tostring(L, -1));
+  if (lua_istable(L, -1))
+    for (lua_pushnil(L); lua_next(L, table) != 0; lua_pop(L, 1))
+      draw_menu_item(lua_tostring(L, -2), lua_tostring(L, -1));
 
+  lua_pop(L, 1);
   attroff(A_BOLD);
 }