]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Merge pull request #11987 from rgacogne/ddist-api-less-allocs
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 27 Sep 2022 10:13:43 +0000 (12:13 +0200)
committerGitHub <noreply@github.com>
Tue, 27 Sep 2022 10:13:43 +0000 (12:13 +0200)
dnsdist: Slightly reduce the number of allocations in API calls

1  2 
pdns/dnsdist-web.cc

index f94571df2a5086ebe216a5c7c18d056382a26939,4795542c8e0022bb3b0e6c6405fe90a47af368dd..7aba31a28bad7ddf10191936ec756db59877b026
@@@ -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";