From: Remi Gacogne Date: Tue, 27 Sep 2022 10:13:43 +0000 (+0200) Subject: Merge pull request #11987 from rgacogne/ddist-api-less-allocs X-Git-Tag: rec-4.9.0-alpha0~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2ed161dfce65dc018442238d6bd006a5da2e6eb6;p=thirdparty%2Fpdns.git Merge pull request #11987 from rgacogne/ddist-api-less-allocs dnsdist: Slightly reduce the number of allocations in API calls --- 2ed161dfce65dc018442238d6bd006a5da2e6eb6 diff --cc pdns/dnsdist-web.cc index f94571df2a,4795542c8e..7aba31a28b --- a/pdns/dnsdist-web.cc +++ b/pdns/dnsdist-web.cc @@@ -945,10 -940,10 +943,10 @@@ static void handleJSONStats(const YaHTT {"blocks", (double)node.d_value.blocks}, {"action", DNSAction::typeToString(node.d_value.action != DNSAction::Action::None ? node.d_value.action : g_dynBlockAction) } }; - obj.insert({dom, thing}); + obj.emplace(dom, thing); } }); - +#endif /* DISABLE_DYNBLOCKS */ Json my_json = obj; resp.body = my_json.dump(); resp.headers["Content-Type"] = "application/json";