]> granicus.if.org Git - pdns/commitdiff
some ring statistics speedups
authorbert hubert <bert.hubert@netherlabs.nl>
Mon, 7 Dec 2015 06:40:04 +0000 (07:40 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Mon, 7 Dec 2015 06:40:04 +0000 (07:40 +0100)
pdns/dnsdist-lua.cc

index 9c577d7b2f64d655afb86b22be038a79d2e39b34..c5a538d152650e9b95a773d9b4bcce90272c2298 100644 (file)
@@ -704,6 +704,7 @@ vector<std::function<void(void)>> setupLua(bool client, const std::string& confi
       }
       // cout<<"Looked at "<<total<<" queries, "<<counts.size()<<" different ones"<<endl;
       vector<pair<int, DNSName>> rcounts;
+      rcounts.reserve(counts.size());
       for(const auto& c : counts) 
        rcounts.push_back(make_pair(c.second, c.first));
 
@@ -776,6 +777,7 @@ vector<std::function<void(void)>> setupLua(bool client, const std::string& confi
       }
       //      cout<<"Looked at "<<total<<" responses, "<<counts.size()<<" different ones"<<endl;
       vector<pair<int, DNSName>> rcounts;
+      rcounts.reserve(counts.size());
       for(const auto& c : counts) 
        rcounts.push_back(make_pair(c.second, c.first));