From e7c855f0898ba289cd0b0eaede0ed387aca4e36a Mon Sep 17 00:00:00 2001 From: Mathew Versluys Date: Sun, 15 May 2016 22:35:34 -0700 Subject: [PATCH] Removed (now) unneeded table test from get_headers(). --- src/host/http.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/host/http.c b/src/host/http.c index f434298e..6eaea049 100644 --- a/src/host/http.c +++ b/src/host/http.c @@ -108,15 +108,12 @@ static void curl_init() static void get_headers(lua_State* L, int headersIndex, struct curl_slist** headers) { - if (lua_istable(L, headersIndex)) + lua_pushnil(L); + while (lua_next(L, headersIndex) != 0) { - lua_pushnil(L); - while (lua_next(L, headersIndex) != 0) - { - const char *item = luaL_checkstring(L, -1); - lua_pop(L, 1); - *headers = curl_slist_append(*headers, item); - } + const char *item = luaL_checkstring(L, -1); + lua_pop(L, 1); + *headers = curl_slist_append(*headers, item); } }