aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJiale Zhi <vipcalio@gmail.com>2015-09-30 22:16:35 -0700
committerJiale Zhi <vipcalio@gmail.com>2015-09-30 22:16:35 -0700
commit8b9e467411d62be4a94b175bfc2ad8cefcc19d1d (patch)
tree2312ab74dc5aa34bc306407dd47ed2ac2d12e843 /lib
parent8171c2edeec0dbd76d5f6a5f1610d41e4e0fb887 (diff)
downloadlua-resty-cookie-8b9e467411d62be4a94b175bfc2ad8cefcc19d1d.tar.gz
lua-resty-cookie-8b9e467411d62be4a94b175bfc2ad8cefcc19d1d.tar.bz2
lua-resty-cookie-8b9e467411d62be4a94b175bfc2ad8cefcc19d1d.zip
Remove unused variable
Diffstat (limited to 'lib')
-rw-r--r--lib/resty/cookie.lua11
1 files 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