mirror of
https://github.com/nlohmann/json.git
synced 2026-10-19 20:48:13 +00:00
Address the review: null inline nodes, trait spelling, and max() in json_view
- inline_nodes is null when the document has no inline nodes, instead of pointing past the end of the allocation; shrink_to_fit() no longer passes it to memcpy() for an empty node array - is_byte_char and is_wide_char use conjunction/disjunction, which astyle leaves unspaced - append_stream() uses (std::max) for the count read Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
4 files changed
+18
-12
No files matched your search
@@ -443,7 +443,10 @@ class basic_json_document
|
||||
|
||||
if (shrink_nodes)
|
||||
{
|
||||
std::memcpy(fresh, d.nodes, d.node_count * sizeof(node));
|
||||
if (d.node_count != 0)
|
||||
{
|
||||
std::memcpy(fresh, d.nodes, d.node_count * sizeof(node));
|
||||
}
|
||||
::operator delete (d.nodes);
|
||||
d.nodes = fresh;
|
||||
d.node_capacity = into_header ? d.inline_capacity : d.node_count;
|
||||
|
||||
Reference in new issue
Block a user