diff options
author | Mark Pulford <mark@kyne.com.au> | 2011-04-16 22:39:20 +0930 |
---|---|---|
committer | Mark Pulford <mark@kyne.com.au> | 2011-04-16 22:39:20 +0930 |
commit | 2b693fb4493764e71f11b6257c0ce58cdbb8a779 (patch) | |
tree | 9705cf253ecb4406f54faaccc75ff621d9db771b | |
parent | b8cf41c24626ecf184c15575412d1914b54a3db8 (diff) | |
download | lua-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.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -343,7 +343,7 @@ static void json_process_value(lua_State *l, json_parse_t *json, json_token_t *t | |||
343 | static json_token_type_t json_ch2token[256]; | 343 | static json_token_type_t json_ch2token[256]; |
344 | static char json_ch2escape[256]; | 344 | static char json_ch2escape[256]; |
345 | 345 | ||
346 | static void json_init_lookup_tables() | 346 | void 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 */ |