mirror of
https://github.com/nlohmann/json.git
synced 2026-10-24 14:58:54 +00:00
Simplify the serializer as suggested in review
- Test JSON_LITTLE_ENDIAN_TARGET (#5876) instead of repeating its condition as JSON_DUMP_SHORT_STRINGS. - Let dump() write a top-level scalar through dump_element(), so that dump_internal() becomes dump_container() and handles objects and arrays only; pass 0 as indentation on the compact paths. - Rename put_quoted() to put_object_key(), its only use. - Share the fast path of put_indent() and put_literal_indent() in put_short_literal_indent(), and use put_literal_indent() for binary values and the closing brackets of dump_iteratively(). - Assert that write_u_escapes() sees sequences of 2 to 4 bytes only. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
3 files changed
+330
-384
No files matched your search
@@ -33,7 +33,6 @@
|
||||
#undef JSON_SCAN_SSSE3_TARGET
|
||||
#undef JSON_SCAN_VECTOR
|
||||
#undef JSON_SCAN_VECTOR_UTF8
|
||||
#undef JSON_DUMP_SHORT_STRINGS
|
||||
|
||||
#ifndef JSON_TEST_KEEP_MACROS
|
||||
#undef JSON_CATCH
|
||||
|
||||
Reference in new issue
Block a user