diff options
author | Jiale Zhi <vipcalio@gmail.com> | 2013-10-29 12:56:26 -0700 |
---|---|---|
committer | Jiale Zhi <vipcalio@gmail.com> | 2013-10-29 12:56:26 -0700 |
commit | c03e4c1adc54a9d0ce418f28ec505c1cb7215432 (patch) | |
tree | 869e9f892cd811e5f1ec868d9b58d0b9c4051ce4 /lib/resty | |
parent | a51034eda320f13eca2e0f05a0a17459d907d90e (diff) | |
download | lua-resty-cookie-c03e4c1adc54a9d0ce418f28ec505c1cb7215432.tar.gz lua-resty-cookie-c03e4c1adc54a9d0ce418f28ec505c1cb7215432.tar.bz2 lua-resty-cookie-c03e4c1adc54a9d0ce418f28ec505c1cb7215432.zip |
Store string length for later use
Diffstat (limited to 'lib/resty')
-rw-r--r-- | lib/resty/cookie.lua | 3 |
1 files changed, 2 insertions, 1 deletions
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) |