Tidy the view serializer: doxygen block placement, enabled() for a constant

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-10-11 10:29:02 +02:00
1 parent bf51d827ad
commit 3d06960f83
1 file changed
+11 -11
+11 -11
View File
@@ -357,16 +357,6 @@ class view_serializer
} }
private: private:
/*!
@brief the compact output without ensure_ascii (the default dump())
The same walk as dump(), with the write position in a local variable
(stores through char pointers would otherwise force a reload of the
buffer's members after each one), and with strings and number tokens of
the source copied by fixed-size moves of 32 bytes where the source has
that many bytes left, instead of a library call per token. The buffer
keeps 64 bytes of slack for the overshoot.
*/
/// a string that is not a plain string of the source (decoded, or written /// a string that is not a plain string of the source (decoded, or written
/// by an edit), without ensure_ascii: runs without characters to escape /// by an edit), without ensure_ascii: runs without characters to escape
/// are copied /// are copied
@@ -405,6 +395,16 @@ class view_serializer
return option; return option;
} }
/*!
@brief the compact output without ensure_ascii (the default dump())
The same walk as dump(), with the write position in a local variable
(stores through char pointers would otherwise force a reload of the
buffer's members after each one), and with strings and number tokens of
the source copied by fixed-size moves of 32 bytes where the source has
that many bytes left, instead of a library call per token. The buffer
keeps 64 bytes of slack for the overshoot.
*/
template<bool SourceNumbers> template<bool SourceNumbers>
void dump_compact(const node* root) void dump_compact(const node* root)
{ {
@@ -526,7 +526,7 @@ class view_serializer
room(n->len); room(n->len);
copy(src + n->off, n->len); copy(src + n->off, n->len);
} }
else if (std::is_same<number_float_t, double>::value) else if (enabled(std::is_same<number_float_t, double>::value))
{ {
room(64); room(64);
w = write_double_at(w, *n); w = write_double_at(w, *n);