Skip to content

Commit

Permalink
convert make_pair to emplace
Browse files Browse the repository at this point in the history
emplace* forwards the arguments directly. Avoids needing make_pair.

Signed-off-by: Rosen Penev <[email protected]>
  • Loading branch information
neheb committed Oct 18, 2021
1 parent dfd958d commit e32a8d4
Show file tree
Hide file tree
Showing 55 changed files with 227 additions and 232 deletions.
2 changes: 1 addition & 1 deletion modules/tinydnsbackend/tinydnsbackend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void TinyDNSBackend::getUpdatedMasters(vector<DomainInfo>* retDomains)
auto domainInfo = s_domainInfo.lock(); //TODO: We could actually lock less if we do it per suffix.
if (!domainInfo->count(d_suffix)) {
TDI_t tmp;
domainInfo->insert(make_pair(d_suffix, tmp));
domainInfo->emplace(d_suffix, tmp);
}

TDI_t* domains = &(*domainInfo)[d_suffix];
Expand Down
2 changes: 1 addition & 1 deletion pdns/auth-zonecache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void AuthZoneCache::add(const DNSName& zone, const int zoneId)
{
auto pending = d_pending.lock();
if (pending->d_replacePending) {
pending->d_pendingAdds.push_back({zone, zoneId});
pending->d_pendingAdds.emplace_back(zone, zoneId);
}
}

Expand Down
4 changes: 2 additions & 2 deletions pdns/bpf-filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ std::vector<std::pair<ComboAddress, uint64_t> > BPFFilter::getAddrStats()
v4Key = nextV4Key;
if (bpf_lookup_elem(maps->d_v4map.getHandle(), &v4Key, &value) == 0) {
v4Addr.sin_addr.s_addr = ntohl(v4Key);
result.push_back(make_pair(ComboAddress(&v4Addr), value));
result.emplace_back(ComboAddress(&v4Addr), value);
}

res = bpf_get_next_key(maps->d_v4map.getHandle(), &v4Key, &nextV4Key);
Expand All @@ -399,7 +399,7 @@ std::vector<std::pair<ComboAddress, uint64_t> > BPFFilter::getAddrStats()
if (bpf_lookup_elem(maps->d_v6map.getHandle(), &nextV6Key, &value) == 0) {
memcpy(&v6Addr.sin6_addr.s6_addr, &nextV6Key, sizeof(nextV6Key));

result.push_back(make_pair(ComboAddress(&v6Addr), value));
result.emplace_back(ComboAddress(&v6Addr), value);
}

res = bpf_get_next_key(maps->d_v6map.getHandle(), &nextV6Key, &nextV6Key);
Expand Down
4 changes: 2 additions & 2 deletions pdns/calidns.cc
Original file line number Diff line number Diff line change
Expand Up @@ -399,14 +399,14 @@ try
if(!subnet.empty() || !ecsRange.empty()) {
EDNSSubnetOpts opt;
opt.source = Netmask(subnet.empty() ? "0.0.0.0/32" : subnet);
ednsOptions.push_back(std::make_pair(EDNSOptionCode::ECS, makeEDNSSubnetOptsString(opt)));
ednsOptions.emplace_back(EDNSOptionCode::ECS, makeEDNSSubnetOptsString(opt));
}

if(!ednsOptions.empty() || pw.getHeader()->id % 2) {
pw.addOpt(1500, 0, EDNSOpts::DNSSECOK, ednsOptions);
pw.commit();
}
unknown.emplace_back(std::make_shared<vector<uint8_t>>(packet));
unknown.push_back(std::make_shared<vector<uint8_t>>(packet));
}

shuffle(unknown.begin(), unknown.end(), pdns::dns_random_engine());
Expand Down
2 changes: 1 addition & 1 deletion pdns/cdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ bool CDB::readNext(pair<string, string> &value) {
throw std::runtime_error("Error while reading value for key '" + key + "' from CDB database: " + std::to_string(ret));
}

value = make_pair(std::move(key), std::move(val));
value = {std::move(key), std::move(val)};
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion pdns/dbdnsseckeeper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ DNSSECKeeper::keyset_t DNSSECKeeper::getKeys(const DNSName& zone, bool useCache)
else
kmd.keyType = ZSK;

retkeyset.push_back(make_pair(dpk, kmd));
retkeyset.emplace_back(dpk, kmd);
}
sort(retkeyset.begin(), retkeyset.end(), keyCompareByKindAndID);

Expand Down
16 changes: 8 additions & 8 deletions pdns/decafsigners.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ DNSCryptoKeyEngine::storvector_t DecafED25519DNSCryptoKeyEngine::convertToISCVec
PrivateKey: ODIyNjAzODQ2MjgwODAxMjI2NDUxOTAyMDQxNDIyNjI=
*/

storvector_t storvector;

storvector.push_back(make_pair("Algorithm", "15 (ED25519)"));
storvector.push_back(make_pair("PrivateKey", string((char*)d_seckey, DECAF_EDDSA_25519_PRIVATE_BYTES)));
auto storvector = storvector_t{
{"Algorithm", "15 (ED25519)"},
{"PrivateKey", string((char*)d_seckey, DECAF_EDDSA_25519_PRIVATE_BYTES)},
};

return storvector;
}
Expand Down Expand Up @@ -203,10 +203,10 @@ DNSCryptoKeyEngine::storvector_t DecafED448DNSCryptoKeyEngine::convertToISCVecto
PrivateKey: xZ+5Cgm463xugtkY5B0Jx6erFTXp13rYegst0qRtNsOYnaVpMx0Z/c5EiA9x8wWbDDct/U3FhYWA
*/

storvector_t storvector;

storvector.push_back(make_pair("Algorithm", "16 (ED448)"));
storvector.push_back(make_pair("PrivateKey", string((char*)d_seckey, DECAF_EDDSA_448_PRIVATE_BYTES)));
auto storvector = storvector_t{
{"Algorithm", "16 (ED448)"},
{"PrivateKey", string((char*)d_seckey, DECAF_EDDSA_448_PRIVATE_BYTES)},
};

return storvector;
}
Expand Down
2 changes: 1 addition & 1 deletion pdns/delaypipe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ void DelayPipe<T>::worker()
if(delay != 0 ) {
int ret = d_pipe.readTimeout(&c, delay);
if(ret > 0) { // we got an object
d_work.insert(make_pair(c.when, c.what));
d_work.emplace(c.when, c.what);
}
else if(ret==0) { // EOF
break;
Expand Down
2 changes: 1 addition & 1 deletion pdns/distributor.hh
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ template<class Answer, class Question, class Backend>MultiThreadDistributor<Answ
int fds[2];
if(pipe(fds) < 0)
unixDie("Creating pipe");
d_pipes.push_back({fds[0],fds[1]});
d_pipes.emplace_back(fds[0], fds[1]);
}

if (n<1) {
Expand Down
2 changes: 1 addition & 1 deletion pdns/dnsbackend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void BackendMakerClass::launch(const string &instr)
throw ArgException("Trying to launch unknown backend '"+module+"'");
}
d_repository[module]->declareArguments(name);
d_instances.push_back(make_pair(module,name));
d_instances.emplace_back(module, name);
}
}

Expand Down
2 changes: 1 addition & 1 deletion pdns/dnsdist-console.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ static void feedConfigDelta(const std::string& line)
return;
struct timeval now;
gettimeofday(&now, 0);
g_confDelta.push_back({now,line});
g_confDelta.emplace_back(now, line);
}

static string historyFile(const bool &ignoreHOME = false)
Expand Down
14 changes: 7 additions & 7 deletions pdns/dnsdist-lua-inspection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static std::unordered_map<unsigned int, vector<boost::variant<string,double>>> g
vector<pair<unsigned int, DNSName>> rcounts;
rcounts.reserve(counts.size());
for(const auto& c : counts)
rcounts.push_back(make_pair(c.second, c.first.makeLowerCase()));
rcounts.emplace_back(c.second, c.first.makeLowerCase());

sort(rcounts.begin(), rcounts.end(), [](const decltype(rcounts)::value_type& a,
const decltype(rcounts)::value_type& b) {
Expand Down Expand Up @@ -150,7 +150,7 @@ static vector<pair<unsigned int, std::unordered_map<string,string> > > getRespRi
continue;
e["qname"]=c.name.toString();
e["rcode"]=std::to_string(c.dh.rcode);
ret.push_back(std::make_pair(count,e));
ret.emplace_back(count, e);
count++;
}
}
Expand Down Expand Up @@ -251,7 +251,7 @@ void setupLuaInspection(LuaContext& luaCtx)
vector<pair<unsigned int, ComboAddress>> rcounts;
rcounts.reserve(counts.size());
for(const auto& c : counts)
rcounts.push_back(make_pair(c.second, c.first));
rcounts.emplace_back(c.second, c.first);

sort(rcounts.begin(), rcounts.end(), [](const decltype(rcounts)::value_type& a,
const decltype(rcounts)::value_type& b) {
Expand Down Expand Up @@ -296,7 +296,7 @@ void setupLuaInspection(LuaContext& luaCtx)
vector<pair<unsigned int, DNSName>> rcounts;
rcounts.reserve(counts.size());
for(const auto& c : counts)
rcounts.push_back(make_pair(c.second, c.first.makeLowerCase()));
rcounts.emplace_back(c.second, c.first.makeLowerCase());

sort(rcounts.begin(), rcounts.end(), [](const decltype(rcounts)::value_type& a,
const decltype(rcounts)::value_type& b) {
Expand Down Expand Up @@ -478,7 +478,7 @@ void setupLuaInspection(LuaContext& luaCtx)
if (c.dh.opcode != 0) {
extra = " (" + Opcode::to_s(c.dh.opcode) + ")";
}
out.insert(make_pair(c.when, (fmt % DiffTime(now, c.when) % c.requestor.toStringWithPort() % dnsdist::Protocol(c.protocol).toString() % "" % htons(c.dh.id) % c.name.toString() % qt.toString() % "" % (c.dh.tc ? "TC" : "") % (c.dh.rd? "RD" : "") % (c.dh.aa? "AA" : "") % ("Question" + extra)).str() )) ;
out.emplace(c.when, (fmt % DiffTime(now, c.when) % c.requestor.toStringWithPort() % dnsdist::Protocol(c.protocol).toString() % "" % htons(c.dh.id) % c.name.toString() % qt.toString() % "" % (c.dh.tc ? "TC" : "") % (c.dh.rd ? "RD" : "") % (c.dh.aa ? "AA" : "") % ("Question" + extra)).str());

if(limit && *limit==++num)
break;
Expand Down Expand Up @@ -516,10 +516,10 @@ void setupLuaInspection(LuaContext& luaCtx)
}

if (c.usec != std::numeric_limits<decltype(c.usec)>::max()) {
out.insert(make_pair(c.when, (fmt % DiffTime(now, c.when) % c.requestor.toStringWithPort() % dnsdist::Protocol(c.protocol).toString() % c.ds.toStringWithPort() % htons(c.dh.id) % c.name.toString() % qt.toString() % (c.usec/1000.0) % (c.dh.tc ? "TC" : "") % (c.dh.rd? "RD" : "") % (c.dh.aa? "AA" : "") % (RCode::to_s(c.dh.rcode) + extra)).str() )) ;
out.emplace(c.when, (fmt % DiffTime(now, c.when) % c.requestor.toStringWithPort() % dnsdist::Protocol(c.protocol).toString() % c.ds.toStringWithPort() % htons(c.dh.id) % c.name.toString() % qt.toString() % (c.usec / 1000.0) % (c.dh.tc ? "TC" : "") % (c.dh.rd ? "RD" : "") % (c.dh.aa ? "AA" : "") % (RCode::to_s(c.dh.rcode) + extra)).str());
}
else {
out.insert(make_pair(c.when, (fmt % DiffTime(now, c.when) % c.requestor.toStringWithPort() % dnsdist::Protocol(c.protocol).toString() % c.ds.toStringWithPort() % htons(c.dh.id) % c.name.toString() % qt.toString() % "T.O" % (c.dh.tc ? "TC" : "") % (c.dh.rd? "RD" : "") % (c.dh.aa? "AA" : "") % (RCode::to_s(c.dh.rcode) + extra)).str() )) ;
out.emplace(c.when, (fmt % DiffTime(now, c.when) % c.requestor.toStringWithPort() % dnsdist::Protocol(c.protocol).toString() % c.ds.toStringWithPort() % htons(c.dh.id) % c.name.toString() % qt.toString() % "T.O" % (c.dh.tc ? "TC" : "") % (c.dh.rd ? "RD" : "") % (c.dh.aa ? "AA" : "") % (RCode::to_s(c.dh.rcode) + extra)).str());
}

if (limit && *limit == ++num) {
Expand Down
10 changes: 5 additions & 5 deletions pdns/dnsdist-lua.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static bool loadTLSCertificateAndKeys(const std::string& context, std::vector<st
auto certFile = boost::get<std::string>(certFiles);
auto keyFile = boost::get<std::string>(keyFiles);
pairs.clear();
pairs.push_back({certFile, keyFile});
pairs.emplace_back(certFile, keyFile);
}
else if (certFiles.type() == typeid(std::vector<std::pair<int,std::string>>) && keyFiles.type() == typeid(std::vector<std::pair<int,std::string>>))
{
Expand All @@ -147,7 +147,7 @@ static bool loadTLSCertificateAndKeys(const std::string& context, std::vector<st
if (certFilesVect.size() == keyFilesVect.size()) {
pairs.clear();
for (size_t idx = 0; idx < certFilesVect.size(); idx++) {
pairs.push_back({certFilesVect.at(idx).second, keyFilesVect.at(idx).second});
pairs.emplace_back(certFilesVect.at(idx).second, keyFilesVect.at(idx).second);
}
}
else {
Expand Down Expand Up @@ -891,7 +891,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
vector<pair<int, std::shared_ptr<DownstreamState> > > ret;
int count=1;
for(const auto& s : g_dstates.getCopy()) {
ret.push_back(make_pair(count++, s));
ret.emplace_back(count++, s);
}
return ret;
});
Expand Down Expand Up @@ -2311,8 +2311,8 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)

if (vars->count("customResponseHeaders")) {
for (auto const& headerMap : boost::get<std::map<std::string,std::string>>((*vars)["customResponseHeaders"])) {
std::pair<std::string,std::string> headerResponse = std::make_pair(boost::to_lower_copy(headerMap.first), headerMap.second);
frontend->d_customResponseHeaders.push_back(headerResponse);
auto headerResponse = std::make_pair(boost::to_lower_copy(headerMap.first), headerMap.second);
frontend->d_customResponseHeaders.push_back(std::move(headerResponse));
}
}

Expand Down
2 changes: 1 addition & 1 deletion pdns/dnsdistdist/dnsdist-backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ void ServerPool::addServer(shared_ptr<DownstreamState>& server)
as other threads might hold a copy. We can however update the pointer as long as we hold the lock. */
unsigned int count = static_cast<unsigned int>((*servers)->size());
auto newServers = std::make_shared<ServerPolicy::NumberedServerVector>(*(*servers));
newServers->push_back(make_pair(++count, server));
newServers->emplace_back(++count, server);
/* we need to reorder based on the server 'order' */
std::stable_sort(newServers->begin(), newServers->end(), [](const std::pair<unsigned int,std::shared_ptr<DownstreamState> >& a, const std::pair<unsigned int,std::shared_ptr<DownstreamState> >& b) {
return a.second->order < b.second->order;
Expand Down
4 changes: 2 additions & 2 deletions pdns/dnsdistdist/doh.cc
Original file line number Diff line number Diff line change
Expand Up @@ -841,8 +841,8 @@ static void doh_dispatch_query(DOHServerConfig* dsc, h2o_handler_t* self, h2o_re
du->query_at = req->query_at;
du->headers.reserve(req->headers.size);
for (size_t i = 0; i < req->headers.size; ++i) {
du->headers.push_back(std::make_pair(std::string(req->headers.entries[i].name->base, req->headers.entries[i].name->len),
std::string(req->headers.entries[i].value.base, req->headers.entries[i].value.len)));
du->headers.emplace_back(std::string(req->headers.entries[i].name->base, req->headers.entries[i].name->len),
std::string(req->headers.entries[i].value.base, req->headers.entries[i].value.len));
}

#ifdef HAVE_H2O_SOCKET_GET_SSL_SERVER_NAME
Expand Down
8 changes: 4 additions & 4 deletions pdns/dnsgram.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,23 +170,23 @@ try
g_clientQuestions++;
totalQueries++;
counts[make_pair(mdp.d_qname, mdp.d_qtype)]++;
questions.insert(make_pair(mdp.d_qname, mdp.d_qtype));
questions.emplace(mdp.d_qname, mdp.d_qtype);
}
else if(mdp.d_header.rd && mdp.d_header.qr) {
rdacounts[pr.d_pheader.ts.tv_sec + 0.01*(pr.d_pheader.ts.tv_usec/10000)]++;
g_lastanswerTime=pr.d_pheader.ts;
g_clientResponses++;
answers.insert(make_pair(mdp.d_qname, mdp.d_qtype));
answers.emplace(mdp.d_qname, mdp.d_qtype);
}
else if(!mdp.d_header.rd && !mdp.d_header.qr) {
g_lastquestionTime=pr.d_pheader.ts;
g_serverQuestions++;
counts[make_pair(mdp.d_qname, mdp.d_qtype)]++;
questions.insert(make_pair(mdp.d_qname, mdp.d_qtype));
questions.emplace(mdp.d_qname, mdp.d_qtype);
totalQueries++;
}
else if(!mdp.d_header.rd && mdp.d_header.qr) {
answers.insert(make_pair(mdp.d_qname, mdp.d_qtype));
answers.emplace(mdp.d_qname, mdp.d_qtype);
g_serverResponses++;
}

Expand Down
6 changes: 3 additions & 3 deletions pdns/dnspacket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ void DNSPacket::wrapup()
if(d_wantsnsid) {
const static string mode_server_id=::arg()["server-id"];
if(mode_server_id != "disabled") {
opts.push_back(make_pair(EDNSOptionCode::NSID, mode_server_id));
opts.emplace_back(EDNSOptionCode::NSID, mode_server_id);
optsize += EDNS_OPTION_CODE_SIZE + EDNS_OPTION_LENGTH_SIZE + mode_server_id.size();
}
}
Expand Down Expand Up @@ -373,12 +373,12 @@ void DNSPacket::wrapup()
eso.scope = Netmask(eso.source.getNetwork(), maxScopeMask);

string opt = makeEDNSSubnetOptsString(eso);
opts.push_back(make_pair(8, opt)); // 'EDNS SUBNET'
opts.emplace_back(8, opt); // 'EDNS SUBNET'
}

if (d_haveednscookie && d_eco.isWellFormed()) {
d_eco.makeServerCookie(s_EDNSCookieKey, getInnerRemote());
opts.push_back(make_pair(EDNSOptionCode::COOKIE, d_eco.makeOptString()));
opts.emplace_back(EDNSOptionCode::COOKIE, d_eco.makeOptString());
}

if(!opts.empty() || d_haveednssection || d_dnssecOk)
Expand Down
8 changes: 4 additions & 4 deletions pdns/dnsparser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ std::shared_ptr<DNSRecordContent> DNSRecordContent::mastermake(const DNSRecord &
{
uint16_t searchclass = (dr.d_type == QType::OPT) ? 1 : dr.d_class; // class is invalid for OPT

typemap_t::const_iterator i=getTypemap().find(make_pair(searchclass, dr.d_type));
auto i = getTypemap().find(make_pair(searchclass, dr.d_type));
if(i==getTypemap().end() || !i->second) {
return std::make_shared<UnknownRecordContent>(dr, pr);
}
Expand All @@ -135,7 +135,7 @@ std::shared_ptr<DNSRecordContent> DNSRecordContent::mastermake(const DNSRecord &
std::shared_ptr<DNSRecordContent> DNSRecordContent::mastermake(uint16_t qtype, uint16_t qclass,
const string& content)
{
zmakermap_t::const_iterator i=getZmakermap().find(make_pair(qclass, qtype));
auto i = getZmakermap().find(make_pair(qclass, qtype));
if(i==getZmakermap().end()) {
return std::make_shared<UnknownRecordContent>(content);
}
Expand All @@ -152,7 +152,7 @@ std::shared_ptr<DNSRecordContent> DNSRecordContent::mastermake(const DNSRecord &

uint16_t searchclass = (dr.d_type == QType::OPT) ? 1 : dr.d_class; // class is invalid for OPT

typemap_t::const_iterator i=getTypemap().find(make_pair(searchclass, dr.d_type));
auto i = getTypemap().find(make_pair(searchclass, dr.d_type));
if(i==getTypemap().end() || !i->second) {
return std::make_shared<UnknownRecordContent>(dr, pr);
}
Expand Down Expand Up @@ -298,7 +298,7 @@ void MOADNSParser::init(bool query, const pdns_string_view& packet)
d_tsigPos = recordStartPos;
}

d_answers.push_back(make_pair(std::move(dr), pr.getPosition() - sizeof(dnsheader)));
d_answers.emplace_back(std::move(dr), pr.getPosition() - sizeof(dnsheader));
}

#if 0
Expand Down
8 changes: 4 additions & 4 deletions pdns/dnsparser.hh
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,13 @@ public:
if(z)
getZmakermap()[make_pair(cl,ty)]=z;

getT2Namemap().insert(make_pair(make_pair(cl,ty), name));
getN2Typemap().insert(make_pair(name, make_pair(cl,ty)));
getT2Namemap().emplace(make_pair(cl, ty), name);
getN2Typemap().emplace(name, make_pair(cl, ty));
}

static void unregist(uint16_t cl, uint16_t ty)
{
pair<uint16_t, uint16_t> key=make_pair(cl, ty);
auto key = make_pair(cl, ty);
getTypemap().erase(key);
getZmakermap().erase(key);
}
Expand All @@ -267,7 +267,7 @@ public:

static const string NumberToType(uint16_t num, uint16_t classnum=1)
{
t2namemap_t::const_iterator iter = getT2Namemap().find(make_pair(classnum, num));
auto iter = getT2Namemap().find(make_pair(classnum, num));
if(iter == getT2Namemap().end())
return "TYPE" + std::to_string(num);
// throw runtime_error("Unknown DNS type with numerical id "+std::to_string(num));
Expand Down
2 changes: 1 addition & 1 deletion pdns/dnspcap2protobuf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ try {
queryTime.tv_sec = pr.d_pheader.ts.tv_sec;
queryTime.tv_usec = pr.d_pheader.ts.tv_usec;
uniqueId = getUniqueID();
ids[dh->id] = std::make_pair(uniqueId, queryTime);
ids[dh->id] = {uniqueId, queryTime};
}
else {
const auto& it = ids.find(dh->id);
Expand Down
2 changes: 1 addition & 1 deletion pdns/dnsrecords.cc
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ void OPTRecordContent::getData(vector<pair<uint16_t, string> >& options)

string field(d_data.c_str() + pos, len);
pos+=len;
options.push_back(make_pair(code, std::move(field)));
options.emplace_back(code, std::move(field));
}
}

Expand Down
4 changes: 2 additions & 2 deletions pdns/dnsreplay.cc
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,8 @@ static void measureResultAndClean(qids_t::const_iterator iter)
if(!g_quiet)
cout<<"\t* orig better *"<<endl;
s_origbetter++;
if(!g_quiet)
if(s_origbetterset.insert(make_pair(qd.d_qi.d_qname, qd.d_qi.d_qtype)).second) {
if (!g_quiet)
if (s_origbetterset.emplace(qd.d_qi.d_qname, qd.d_qi.d_qtype).second) {
cout<<"orig better: " << qd.d_qi.d_qname<<" "<< qd.d_qi.d_qtype<<endl;
}
}
Expand Down
Loading

0 comments on commit e32a8d4

Please sign in to comment.