diff options
author | Gerardo Marset <gammer1994@gmail.com> | 2013-02-25 20:28:28 -0200 |
---|---|---|
committer | Gerardo Marset <gammer1994@gmail.com> | 2013-02-25 20:28:28 -0200 |
commit | 56893e9dcd1eeebffb42b227a2151e18d49bc370 (patch) | |
tree | db1e6c023b75b19bb8d761c3d8df576cd6b4d5cd /src/mbox.lua | |
parent | d548a78e5516bcc85d44f1d419cf53c71d6dcd79 (diff) | |
download | luasocket-56893e9dcd1eeebffb42b227a2151e18d49bc370.tar.gz luasocket-56893e9dcd1eeebffb42b227a2151e18d49bc370.tar.bz2 luasocket-56893e9dcd1eeebffb42b227a2151e18d49bc370.zip |
Use the length operator (#) instead of table.getn.
table.getn was deprecated in Lua 5.1 in favor of #, the length operator.
See: http://www.lua.org/manual/5.1/manual.html#7.2
Diffstat (limited to 'src/mbox.lua')
-rw-r--r-- | src/mbox.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mbox.lua b/src/mbox.lua index b7d4a2a..35adf4e 100644 --- a/src/mbox.lua +++ b/src/mbox.lua | |||
@@ -34,7 +34,7 @@ end | |||
34 | function Public.parse_headers(headers_s) | 34 | function Public.parse_headers(headers_s) |
35 | local headers_t = Public.split_headers(headers_s) | 35 | local headers_t = Public.split_headers(headers_s) |
36 | local headers = {} | 36 | local headers = {} |
37 | for i = 1, table.getn(headers_t) do | 37 | for i = 1, #headers_t do |
38 | local name, value = Public.parse_header(headers_t[i]) | 38 | local name, value = Public.parse_header(headers_t[i]) |
39 | if name then | 39 | if name then |
40 | name = string.lower(name) | 40 | name = string.lower(name) |
@@ -74,7 +74,7 @@ end | |||
74 | 74 | ||
75 | function Public.parse(mbox_s) | 75 | function Public.parse(mbox_s) |
76 | local mbox = Public.split_mbox(mbox_s) | 76 | local mbox = Public.split_mbox(mbox_s) |
77 | for i = 1, table.getn(mbox) do | 77 | for i = 1, #mbox do |
78 | mbox[i] = Public.parse_message(mbox[i]) | 78 | mbox[i] = Public.parse_message(mbox[i]) |
79 | end | 79 | end |
80 | return mbox | 80 | return mbox |