From c03e4c1adc54a9d0ce418f28ec505c1cb7215432 Mon Sep 17 00:00:00 2001 From: Jiale Zhi Date: Tue, 29 Oct 2013 12:56:26 -0700 Subject: Store string length for later use --- lib/resty/cookie.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/resty/cookie.lua b/lib/resty/cookie.lua index c6dfa07..1efe6b7 100644 --- a/lib/resty/cookie.lua +++ b/lib/resty/cookie.lua @@ -41,8 +41,9 @@ local function get_cookie_table(text_cookie) local i = 1 local j = 1 local key, value + local len = #text_cookie - while j <= #text_cookie do + while j <= len do if state == EXPECT_KEY then if get_string_byte(text_cookie, j) == EQUAL then key = get_string_sub(text_cookie, i, j - 1) -- cgit v1.2.3-70-g09d2