summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Pulford <mark@kyne.com.au>2011-04-16 22:39:20 +0930
committerMark Pulford <mark@kyne.com.au>2011-04-16 22:39:20 +0930
commit2b693fb4493764e71f11b6257c0ce58cdbb8a779 (patch)
tree9705cf253ecb4406f54faaccc75ff621d9db771b
parentb8cf41c24626ecf184c15575412d1914b54a3db8 (diff)
downloadlua-cjson-2b693fb4493764e71f11b6257c0ce58cdbb8a779.tar.gz
lua-cjson-2b693fb4493764e71f11b6257c0ce58cdbb8a779.tar.bz2
lua-cjson-2b693fb4493764e71f11b6257c0ce58cdbb8a779.zip
Initialise lua_json lookup tables once (globally)
-rw-r--r--lua_json.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lua_json.c b/lua_json.c
index 9b7e4e2..25078a3 100644
--- a/lua_json.c
+++ b/lua_json.c
@@ -343,7 +343,7 @@ static void json_process_value(lua_State *l, json_parse_t *json, json_token_t *t
343static json_token_type_t json_ch2token[256]; 343static json_token_type_t json_ch2token[256];
344static char json_ch2escape[256]; 344static char json_ch2escape[256];
345 345
346static void json_init_lookup_tables() 346void lua_json_global_init()
347{ 347{
348 int i; 348 int i;
349 349
@@ -693,8 +693,6 @@ void lua_json_init(lua_State *l)
693 { NULL, NULL } 693 { NULL, NULL }
694 }; 694 };
695 695
696 json_init_lookup_tables();
697
698 luaL_register(l, "json", reg); 696 luaL_register(l, "json", reg);
699 697
700 /* Set json.null, and pop "json" table from the stack */ 698 /* Set json.null, and pop "json" table from the stack */