From d9f8e0d0ab3fd36ec8041ba434a1d6ee3367da5a Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Wed, 27 May 2020 19:55:52 -0700 Subject: [PATCH] ircd::json: Eliminate bool return for printer call. --- ircd/json.cc | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/ircd/json.cc b/ircd/json.cc index e2430c5a9..b6775116d 100644 --- a/ircd/json.cc +++ b/ircd/json.cc @@ -312,10 +312,10 @@ ircd::json::printer template - bool operator()(mutable_buffer &out, gen&&, attr&&...) const; + void operator()(mutable_buffer &out, gen&&, attr&&...) const; template - bool operator()(mutable_buffer &out, gen&&) const; + void operator()(mutable_buffer &out, gen&&) const; printer() :printer::base_type{rule<>{}} @@ -461,7 +461,7 @@ noexcept template [[gnu::visibility("internal")]] -bool +void ircd::json::printer::operator()(mutable_buffer &out, gen&& g, attr&&... a) @@ -472,13 +472,11 @@ const { "Failed to generate JSON" }; - - return true; } template [[gnu::visibility("internal")]] -bool +void ircd::json::printer::operator()(mutable_buffer &out, gen&& g) const @@ -488,8 +486,6 @@ const { "Failed to generate JSON" }; - - return true; } template= tmp); s->append(string_view{tmp, size_t(data(buf) - tmp)}); } @@ -3281,17 +3271,12 @@ ircd::json::escape(const mutable_buffer &buf, const string_view &in) { mutable_buffer out{buf}; - const bool ok - { - printer(out, printer.string, in) - }; - + printer(out, printer.string, in); const string_view ret { data(buf), data(out) }; - assert(ok); return ret; }