diff options
author | Mark Pulford <mark@kyne.com.au> | 2011-05-29 18:03:22 +0930 |
---|---|---|
committer | Mark Pulford <mark@kyne.com.au> | 2011-05-29 18:03:22 +0930 |
commit | 3d1c5e19f45cf484774926ba6e2555d1c8e4c39b (patch) | |
tree | f6cd7cc888ec643d025a37810fe7f15cc91d7381 /strbuf.h | |
parent | c0b473a8e974407dc308ce0fd0058136b9faa90c (diff) | |
download | lua-cjson-3d1c5e19f45cf484774926ba6e2555d1c8e4c39b.tar.gz lua-cjson-3d1c5e19f45cf484774926ba6e2555d1c8e4c39b.tar.bz2 lua-cjson-3d1c5e19f45cf484774926ba6e2555d1c8e4c39b.zip |
Add support for runtime number precision config
Add cjson.encode_number_precision(). Reducing the number precision from
14 to 3 can increase performance up to 50% with number heavy
conversions.
Diffstat (limited to 'strbuf.h')
-rw-r--r-- | strbuf.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -65,10 +65,10 @@ static char *strbuf_string(strbuf_t *s, int *len); | |||
65 | static void strbuf_ensure_empty_length(strbuf_t *s, int len); | 65 | static void strbuf_ensure_empty_length(strbuf_t *s, int len); |
66 | 66 | ||
67 | /* Update */ | 67 | /* Update */ |
68 | extern void strbuf_append_fmt(strbuf_t *s, const char *format, ...); | 68 | extern void strbuf_append_fmt(strbuf_t *s, int len, const char *fmt, ...); |
69 | extern void strbuf_append_fmt_retry(strbuf_t *s, const char *format, ...); | ||
69 | static void strbuf_append_mem(strbuf_t *s, const char *c, int len); | 70 | static void strbuf_append_mem(strbuf_t *s, const char *c, int len); |
70 | extern void strbuf_append_string(strbuf_t *s, const char *str); | 71 | extern void strbuf_append_string(strbuf_t *s, const char *str); |
71 | extern void strbuf_append_number(strbuf_t *s, double number); | ||
72 | static void strbuf_append_char(strbuf_t *s, const char c); | 72 | static void strbuf_append_char(strbuf_t *s, const char c); |
73 | static void strbuf_ensure_null(strbuf_t *s); | 73 | static void strbuf_ensure_null(strbuf_t *s); |
74 | 74 | ||