commit | de76a3772b5642d093765e2cf1de5b9e0201067c | [log] [tgz] |
---|---|---|
author | winsweet <winsweet@gmail.com> | Tue Dec 09 16:14:51 2014 +0800 |
committer | Roger Meier <roger@apache.org> | Sat Dec 13 21:29:55 2014 +0100 |
tree | 7e2da3defdababf62598e47c8d4dc65e25399103 | |
parent | 3c5a788d8f243e23474b3ac09a795e4e15a8933f [diff] [blame] |
THRIFT-2882 Lua Generator: using string.len funtion to get struct(map,list,set) size
diff --git a/lib/lua/Thrift.lua b/lib/lua/Thrift.lua index da5bb63..a9a9078 100644 --- a/lib/lua/Thrift.lua +++ b/lib/lua/Thrift.lua
@@ -40,6 +40,14 @@ error(e) end +function ttable_size(t) + local count = 0 + for k, v in pairs(t) do + count = count + 1 + end + return count +end + version = 1.0 TType = {