0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-05-20 03:43:47 +02:00

ircd::json: Logical revert of a4766e583; reduces to minor cleanup/simplify.

This commit is contained in:
Jason Volk 2020-09-15 16:51:41 -07:00
parent a2df9a9cdc
commit 1668bee2e5

View file

@ -4751,6 +4751,9 @@ ircd::json::stringify(mutable_buffer &buf,
size_t
ircd::json::serialized(const string_view &v)
{
if(v.empty() && defined(v))
return size(empty_string);
// Query the json::type of the input string here in relaxed mode. The
// json::value ctor uses strict_t by default which is a full validation;
// we don't care about that for the serialized() suite.
@ -4759,9 +4762,7 @@ ircd::json::serialized(const string_view &v)
v, json::type(v, std::nothrow)
};
return v.empty() && defined(value)?
size(empty_string):
serialized(value);
return serialized(value);
}
///////////////////////////////////////////////////////////////////////////////