From 8b9e467411d62be4a94b175bfc2ad8cefcc19d1d Mon Sep 17 00:00:00 2001 From: Jiale Zhi Date: Wed, 30 Sep 2015 22:16:35 -0700 Subject: Remove unused variable --- lib/resty/cookie.lua | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/resty/cookie.lua b/lib/resty/cookie.lua index dfb8f8a..2f2bd77 100644 --- a/lib/resty/cookie.lua +++ b/lib/resty/cookie.lua @@ -15,10 +15,10 @@ local SEMICOLON = byte(";") local SPACE = byte(" ") local HTAB = byte("\t") - +-- table.new(narr, nrec) local ok, new_tab = pcall(require, "table.new") if not ok then - new_tab = function (narr, nrec) return {} end + new_tab = function () return {} end end local ok, clear_tab = pcall(require, "table.clear") @@ -31,9 +31,6 @@ local _M = new_tab(0, 2) _M._VERSION = '0.01' -local mt = { __index = _M } - - local function get_cookie_table(text_cookie) if type(text_cookie) ~= "string" then log(ERR, format("expect text_cookie to be \"string\" but found %s", @@ -105,7 +102,7 @@ function _M.new(self) --return nil, "no cookie found in current request" --end return setmetatable({ _cookie = _cookie, set_cookie_table = new_tab(4, 0) }, - mt) + { __index = self }) end function _M.get(self, key) @@ -120,8 +117,6 @@ function _M.get(self, key) end function _M.get_all(self) - local err - if not self._cookie then return nil, "no cookie found in the current request" end -- cgit v1.2.3-54-g00ecf