From b4f1c4a7bcc306286ada61f6ecf2c78ef4cffa67 Mon Sep 17 00:00:00 2001 From: Mark Pulford Date: Tue, 20 Dec 2011 23:42:12 +1030 Subject: Clarify optional args and return values --- manual.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/manual.txt b/manual.txt index 594f139..2917339 100644 --- a/manual.txt +++ b/manual.txt @@ -304,6 +304,9 @@ not freed until the Lua CJSON module is garbage collected. Setting this option to +false+ will cause the buffer to be freed after each call to +cjson.encode+. +This setting is only changed when an argument is provided. The current +setting is always returned. + [[encode_max_depth]] encode_max_depth @@ -318,6 +321,9 @@ depth = cjson.encode_max_depth([depth]) By default, Lua CJSON will reject data structure with more than 20 nested tables. +This setting is only changed when an argument is provided. The current +setting is always returned. + This check prevents a deeply nested or recursive data structure from crashing the application. @@ -340,6 +346,9 @@ precision = cjson.encode_number_precision([precision]) By default, Lua CJSON will output 14 significant digits when converting a number to text. +This setting is only changed when an argument is provided. The current +setting is always returned. + Reducing number precision to _3_ can improve performance of number heavy JSON conversions by up to 50%. @@ -360,6 +369,9 @@ Lua CJSON classifies Lua tables into 3 types when encoding as a JSON array. This is determined by the number of values missing for keys up to the maximum index: +Each particular setting is only changed when that argument is +provided. The current settings are always returned. + [horizontal] Normal:: All values are available. Sparse:: At least 1 value is missing. @@ -410,6 +422,9 @@ specification (_invalid numbers_): By default Lua CJSON will decode _invalid numbers_, but will refuse to encode them. +This setting is only changed when an argument is provided. The current +setting is always returned. + This setting can be configured separately for encoding and/or decoding: -- cgit v1.2.3-55-g6feb