From 1668bee2e512c1234fd4dc399a0d8a73350561cc Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 15 Sep 2020 16:51:41 -0700 Subject: [PATCH] ircd::json: Logical revert of a4766e583; reduces to minor cleanup/simplify. --- ircd/json.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ircd/json.cc b/ircd/json.cc index a7dd9aba4..7ff49e701 100644 --- a/ircd/json.cc +++ b/ircd/json.cc @@ -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); } ///////////////////////////////////////////////////////////////////////////////