]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
remove make_tuple and make_pair
authorRosen Penev <rosenp@gmail.com>
Fri, 1 Sep 2023 08:41:48 +0000 (08:41 +0000)
committerRosen Penev <rosenp@gmail.com>
Mon, 4 Sep 2023 16:09:24 +0000 (16:09 +0000)
Not needed

Signed-off-by: Rosen Penev <rosenp@gmail.com>
22 files changed:
modules/lmdbbackend/lmdbbackend.cc
pdns/bpf-filter.cc
pdns/channel.hh
pdns/dnsdist-dynbpf.cc
pdns/dnsdist-lua.cc
pdns/dnsdistdist/dnsdist-lbpolicies.cc
pdns/gss_context.cc
pdns/libssl.cc
pdns/lua-auth4.cc
pdns/lua-record.cc
pdns/pdnsutil.cc
pdns/recursordist/rec-lua-conf.cc
pdns/recursordist/rec-zonetocache.cc
pdns/recursordist/rec_channel_rec.cc
pdns/recursordist/recursor_cache.cc
pdns/recursordist/syncres.cc
pdns/shuffle.cc
pdns/signingpipe.cc
pdns/slavecommunicator.cc
pdns/statbag.hh
pdns/test-ueberbackend_cc.cc
pdns/validate.cc

index 11168f326677286c845a9c1df00daaea830f8377..9b600f1370643e681e42b61f322f33e9eaed5767 100644 (file)
@@ -88,7 +88,7 @@ std::pair<uint32_t, uint32_t> LMDBBackend::getSchemaVersionAndShards(std::string
   if ((rc = mdb_env_open(env, filename.c_str(), MDB_NOSUBDIR | MDB_RDONLY, 0600)) != 0) {
     if (rc == ENOENT) {
       // we don't have a database yet! report schema 0, with 0 shards
-      return std::make_pair(0, 0);
+      return {0u, 0u};
     }
     mdb_env_close(env);
     throw std::runtime_error("mdb_env_open failed");
@@ -109,7 +109,7 @@ std::pair<uint32_t, uint32_t> LMDBBackend::getSchemaVersionAndShards(std::string
       // we pretend this means 5
       mdb_txn_abort(txn);
       mdb_env_close(env);
-      return std::make_pair(5, 0);
+      return {5u, 0u};
     }
     mdb_txn_abort(txn);
     mdb_env_close(env);
@@ -127,7 +127,7 @@ std::pair<uint32_t, uint32_t> LMDBBackend::getSchemaVersionAndShards(std::string
       // we pretend this means 5
       mdb_txn_abort(txn);
       mdb_env_close(env);
-      return std::make_pair(5, 0);
+      return {5u, 0u};
     }
 
     throw std::runtime_error("mdb_get pdns.schemaversion failed");
@@ -183,7 +183,7 @@ std::pair<uint32_t, uint32_t> LMDBBackend::getSchemaVersionAndShards(std::string
   mdb_txn_abort(txn);
   mdb_env_close(env);
 
-  return std::make_pair(schemaversion, shards);
+  return {schemaversion, shards};
 }
 
 namespace
@@ -1702,7 +1702,7 @@ void LMDBBackend::getAllDomainsFiltered(vector<DomainInfo>* domains, const std::
       di.id = iter.getID();
       di.backend = this;
 
-      if (!zonemap.insert(std::make_pair(di.zone, di)).second) {
+      if (!zonemap.emplace(di.zone, di).second) {
         dups.insert(di.zone);
       }
     }
index bb0c58e01d9c7f44fdf176afcc55d610277282d9..ec6bd05c5528cbd2517350fce1cdf324bf092de5 100644 (file)
@@ -832,7 +832,7 @@ std::vector<std::tuple<DNSName, uint16_t, uint64_t> > BPFFilter::getQNameStats()
     while (res == 0) {
       if (bpf_lookup_elem(map.d_fd.getHandle(), &nextKey, &value) == 0) {
         nextKey.qname[sizeof(nextKey.qname) - 1 ] = '\0';
-        result.push_back(std::make_tuple(DNSName(reinterpret_cast<const char*>(nextKey.qname), sizeof(nextKey.qname), 0, false), value.qtype, value.counter));
+        result.emplace_back(DNSName(reinterpret_cast<const char*>(nextKey.qname), sizeof(nextKey.qname), 0, false), value.qtype, value.counter);
       }
 
       res = bpf_get_next_key(map.d_fd.getHandle(), &nextKey, &nextKey);
@@ -853,7 +853,7 @@ std::vector<std::tuple<DNSName, uint16_t, uint64_t> > BPFFilter::getQNameStats()
     while (res == 0) {
       if (bpf_lookup_elem(map.d_fd.getHandle(), &nextKey, &value) == 0) {
         nextKey.qname[sizeof(nextKey.qname) - 1 ] = '\0';
-        result.push_back(std::make_tuple(DNSName(reinterpret_cast<const char*>(nextKey.qname), sizeof(nextKey.qname), 0, false), key.qtype, value.counter));
+        result.emplace_back(DNSName(reinterpret_cast<const char*>(nextKey.qname), sizeof(nextKey.qname), 0, false), key.qtype, value.counter);
       }
 
       res = bpf_get_next_key(map.d_fd.getHandle(), &nextKey, &nextKey);
index 2d848fc9eee35db7234dc0c0d885a1eff21c0ec9..d5a1ed6d7349f0f153dbad9576d18c68baf00088 100644 (file)
@@ -341,7 +341,7 @@ namespace channel
       setPipeBufferSize(receiver.getHandle(), pipeBufferSize);
     }
 
-    return std::pair(Sender<T, D>(std::move(sender)), Receiver<T, D>(std::move(receiver), throwOnEOF));
+    return {Sender<T, D>(std::move(sender)), Receiver<T, D>(std::move(receiver), throwOnEOF)};
   }
 }
 }
index c19844de73de005e1c9a87b1a9b3a58aa020ab85..9ede03fabf864f5b3165c75b75c099c5595e833e 100644 (file)
@@ -78,7 +78,7 @@ std::vector<std::tuple<ComboAddress, uint64_t, struct timespec> > DynBPFFilter::
   for (const auto& stat : stats) {
     const container_t::iterator it = data->d_entries.find(stat.first);
     if (it != data->d_entries.end()) {
-      result.push_back(std::make_tuple(stat.first, stat.second, it->d_until));
+      result.emplace_back(stat.first, stat.second, it->d_until);
     }
   }
   return result;
index dcd7a5c3f5c4151b2781cbaf9bc2410ee2ce6dc7..34a6aaf51bb8a373780e81ade756becd1b9785a0 100644 (file)
@@ -942,7 +942,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
     LuaArray<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;
   });
@@ -1683,7 +1683,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
     const auto localPools = g_pools.getCopy();
     for (const auto& entry : localPools) {
       const string& name = entry.first;
-      ret.push_back(make_pair(count++, name));
+      ret.emplace_back(count++, name);
     }
     return ret;
   });
@@ -2380,7 +2380,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
       LuaAssociativeTable<std::string> customResponseHeaders;
       if (getOptionalValue<decltype(customResponseHeaders)>(vars, "customResponseHeaders", customResponseHeaders) > 0) {
         for (auto const& headerMap : customResponseHeaders) {
-          std::pair<std::string, std::string> headerResponse = std::make_pair(boost::to_lower_copy(headerMap.first), headerMap.second);
+          auto headerResponse = std::pair(boost::to_lower_copy(headerMap.first), headerMap.second);
           frontend->d_customResponseHeaders.insert(headerResponse);
         }
       }
index 3aed13d54ab182653fa94ae8e504cb8ca3a566bb..2a890f2e554ab51326b63d219a892564fcadad32 100644 (file)
@@ -41,7 +41,7 @@ template <class T> static std::shared_ptr<DownstreamState> getLeastOutstanding(c
   size_t usableServers = 0;
   for (const auto& d : servers) {
     if (d.second->isUp()) {
-      poss[usableServers] = std::make_pair(std::make_tuple(d.second->outstanding.load(), d.second->d_config.order, d.second->getRelevantLatencyUsec()), d.first);
+      poss[usableServers] = std::pair(std::tuple(d.second->outstanding.load(), d.second->d_config.order, d.second->getRelevantLatencyUsec()), d.first);
       usableServers++;
     }
   }
@@ -101,7 +101,7 @@ template <class T> static std::shared_ptr<DownstreamState> getValRandom(const Se
         sum += d.second->d_config.d_weight;
       }
 
-      poss[usableServers]  = std::make_pair(sum, d.first);
+      poss[usableServers]  = std::pair(sum, d.first);
       usableServers++;
     }
   }
index b76ca1a21845c2cfa7967c1f1940783fd6441ce7..4d5b7e7412afedb3fc86509bbfd6fdd75fd03ca1 100644 (file)
@@ -25,7 +25,7 @@
 
 #ifndef ENABLE_GSS_TSIG
 
-std::tuple<size_t, size_t, size_t> GssContext::getCounts() { return std::make_tuple<size_t, size_t, size_t>(0, 0, 0); }
+std::tuple<size_t, size_t, size_t> GssContext::getCounts() { return std::tuple<size_t, size_t, size_t>(0, 0, 0); }
 bool GssContext::supported() { return false; }
 GssContext::GssContext() :
   d_error(GSS_CONTEXT_UNSUPPORTED), d_type(GSS_CONTEXT_NONE) {}
@@ -490,7 +490,7 @@ bool GssContext::getPeerPrincipal(std::string& name)
 
 std::tuple<size_t, size_t, size_t> GssContext::getCounts()
 {
-  return std::make_tuple(s_gss_init_creds.lock()->size(), s_gss_accept_creds.lock()->size(), s_gss_sec_context.lock()->size());
+  return {s_gss_init_creds.lock()->size(), s_gss_accept_creds.lock()->size(), s_gss_sec_context.lock()->size()};
 }
 
 void GssContext::processError(const std::string& method, OM_uint32 maj, OM_uint32 min)
index 84610832a8d21c8689655261afe7ef10ddaaba98..7be8348261958b6d3afb0fe0817d8c7cd87857b8 100644 (file)
@@ -1032,7 +1032,7 @@ std::pair<std::unique_ptr<SSL_CTX, decltype(&SSL_CTX_free)>, std::vector<std::st
   }
 #endif /* HAVE_SSL_CTX_SET_CIPHERSUITES */
 
-  return std::make_pair(std::move(ctx), std::move(warnings));
+  return {std::move(ctx), std::move(warnings)};
 }
 
 #ifdef HAVE_SSL_CTX_SET_KEYLOG_CALLBACK
index 6707e60f1a731f2d4eed959201e39d0dfa1ef815..0a2eb571a7f59f33916587182eaf57102468b5f9 100644 (file)
@@ -44,7 +44,7 @@ void AuthLua4::postPrepareContext() {
   d_lw->registerFunction<DNSPacket, Netmask()>("getRealRemote", [](DNSPacket &p) { return p.getRealRemote(); });
   d_lw->registerFunction<DNSPacket, ComboAddress()>("getLocal", [](DNSPacket &p) { return p.getLocal(); });
   d_lw->registerFunction<DNSPacket, unsigned int()>("getRemotePort", [](DNSPacket &p) { return p.getInnerRemote().getPort(); });
-  d_lw->registerFunction<DNSPacket, std::tuple<const std::string, unsigned int>()>("getQuestion", [](DNSPacket &p) { return std::make_tuple(p.qdomain.toString(), static_cast<unsigned int>(p.qtype.getCode())); });
+  d_lw->registerFunction<DNSPacket, std::tuple<const std::string, unsigned int>()>("getQuestion", [](DNSPacket &p) { return std::tuple(p.qdomain.toString(), static_cast<unsigned int>(p.qtype.getCode())); });
   d_lw->registerFunction<DNSPacket, void(bool)>("setA", [](DNSPacket &p, bool a) { return p.setA(a); });
   d_lw->registerFunction<DNSPacket, void(unsigned int)>("setID", [](DNSPacket &p, unsigned int id) { return p.setID(static_cast<uint16_t>(id)); });
   d_lw->registerFunction<DNSPacket, void(bool)>("setRA", [](DNSPacket &p, bool ra) { return p.setRA(ra); });
index af27031a032a65bbae03065e29a424b29a096359..e3c7f52c0b2f59c388abc1969ffc19603e8de003 100644 (file)
@@ -60,8 +60,8 @@ private:
       for(const auto& m : rhs.opts)
         rhsoopts[m.first]=m.second;
 
-      return std::make_tuple(rem, url, oopts) <
-        std::make_tuple(rhs.rem, rhs.url, rhsoopts);
+      return std::tuple(rem, url, oopts) <
+        std::tuple(rhs.rem, rhs.url, rhsoopts);
     }
   };
   struct CheckState
index bdf0d3347b977f1cc8e93512ff311dbf611f18ab..078ebe5d11367fc61e14509c3c764e1b1b757c50 100644 (file)
@@ -484,7 +484,7 @@ static int checkZone(DNSSECKeeper &dk, UeberBackend &B, const DNSName& zone, con
           }
           svcbAliases.insert(rr.qname);
         }
-        svcbTargets.emplace(std::make_tuple(rr.qname, svcbrc->getPriority(), svcbrc->getTarget(), svcbrc->autoHint(SvcParam::ipv4hint), svcbrc->autoHint(SvcParam::ipv6hint)));
+        svcbTargets.emplace(rr.qname, svcbrc->getPriority(), svcbrc->getTarget(), svcbrc->autoHint(SvcParam::ipv4hint), svcbrc->autoHint(SvcParam::ipv6hint));
         svcbRecords.insert(rr.qname);
         break;
       case QType::HTTPS:
@@ -495,7 +495,7 @@ static int checkZone(DNSSECKeeper &dk, UeberBackend &B, const DNSName& zone, con
           }
           httpsAliases.insert(rr.qname);
         }
-        httpsTargets.emplace(std::make_tuple(rr.qname, svcbrc->getPriority(), svcbrc->getTarget(), svcbrc->autoHint(SvcParam::ipv4hint), svcbrc->autoHint(SvcParam::ipv6hint)));
+        httpsTargets.emplace(rr.qname, svcbrc->getPriority(), svcbrc->getTarget(), svcbrc->autoHint(SvcParam::ipv4hint), svcbrc->autoHint(SvcParam::ipv6hint));
         httpsRecords.insert(rr.qname);
         break;
       }
index c53c95829a6a923224ae00e3378cd8b9d9d0fad2..ec169e45442118ce1fc381f39288af497944fe24 100644 (file)
@@ -386,7 +386,7 @@ static void rpzPrimary(LuaConfigItems& lci, luaConfigDelayedThreads& delayedThre
     exit(1); // FIXME proper exit code?
   }
 
-  delayedThreads.rpzPrimaryThreads.push_back(std::make_tuple(primaries, defpol, defpolOverrideLocal, maxTTL, zoneIdx, tt, maxReceivedXFRMBytes, localAddress, axfrTimeout, refresh, sr, dumpFile));
+  delayedThreads.rpzPrimaryThreads.emplace_back(primaries, defpol, defpolOverrideLocal, maxTTL, zoneIdx, tt, maxReceivedXFRMBytes, localAddress, axfrTimeout, refresh, sr, dumpFile);
 }
 
 // A wrapper class that loads the standard Lua defintions into the context, so that we can use things like pdns.A
index 2f2cbfabec4e8007138f919bc93d4142d34012b3..408f486eacd3a8bb35d6ed0ba170abf99b5aab0f 100644 (file)
@@ -289,7 +289,7 @@ vState ZoneData::dnssecValidate(pdns::ZoneMD& zonemd, size_t& zonemdCount) const
     if (nsecs.records.size() > 0 && nsecs.signatures.size() > 0) {
       // Valdidate the NSEC
       nsecValidationStatus = validateWithKeySet(d_now, d_zone, nsecs.records, nsecs.signatures, validKeys, std::nullopt);
-      csp.emplace(std::make_pair(d_zone, QType::NSEC), nsecs);
+      csp.emplace(std::pair(d_zone, QType::NSEC), nsecs);
     }
     else if (nsec3s.records.size() > 0 && nsec3s.signatures.size() > 0) {
       // Validate NSEC3PARAMS
@@ -304,7 +304,7 @@ vState ZoneData::dnssecValidate(pdns::ZoneMD& zonemd, size_t& zonemdCount) const
       }
       // Valdidate the NSEC3
       nsecValidationStatus = validateWithKeySet(d_now, zonemd.getNSEC3Label(), nsec3s.records, nsec3s.signatures, validKeys, std::nullopt);
-      csp.emplace(std::make_pair(zonemd.getNSEC3Label(), QType::NSEC3), nsec3s);
+      csp.emplace(std::pair(zonemd.getNSEC3Label(), QType::NSEC3), nsec3s);
     }
     else {
       d_log->info("No NSEC(3) records and/or RRSIGS found to deny ZONEMD");
@@ -438,7 +438,7 @@ void RecZoneToCache::maintainStates(const map<DNSName, Config>& configs, map<DNS
       }
     }
     else {
-      states.emplace(std::make_pair(config.first, State{0, 0, mygeneration}));
+      states.emplace(config.first, State{0, 0, mygeneration});
     }
   }
 }
index 34305559f546305796bb54d5797048a4810dc6d8..b63973313fc9e92e4f3d4376b2f33002c1213f93 100644 (file)
@@ -913,7 +913,7 @@ static ProxyMappingStats_t* pleaseGetProxyMappingStats()
   auto ret = new ProxyMappingStats_t;
   if (t_proxyMapping) {
     for (const auto& [key, entry] : *t_proxyMapping) {
-      ret->emplace(std::make_pair(key, ProxyMappingCounts{entry.stats.netmaskMatches, entry.stats.suffixMatches}));
+      ret->emplace(key, ProxyMappingCounts{entry.stats.netmaskMatches, entry.stats.suffixMatches});
     }
   }
   return ret;
@@ -925,7 +925,7 @@ static RemoteLoggerStats_t* pleaseGetRemoteLoggerStats()
 
   if (t_protobufServers.servers) {
     for (const auto& server : *t_protobufServers.servers) {
-      ret->emplace(std::make_pair(server->address(), server->getStats()));
+      ret->emplace(server->address(), server->getStats());
     }
   }
   return ret.release();
@@ -948,7 +948,7 @@ static RemoteLoggerStats_t* pleaseGetOutgoingRemoteLoggerStats()
 
   if (t_outgoingProtobufServers.servers) {
     for (const auto& server : *t_outgoingProtobufServers.servers) {
-      ret->emplace(std::make_pair(server->address(), server->getStats()));
+      ret->emplace(server->address(), server->getStats());
     }
   }
   return ret.release();
@@ -961,7 +961,7 @@ static RemoteLoggerStats_t* pleaseGetFramestreamLoggerStats()
 
   if (t_frameStreamServersInfo.servers) {
     for (const auto& server : *t_frameStreamServersInfo.servers) {
-      ret->emplace(std::make_pair(server->address(), server->getStats()));
+      ret->emplace(server->address(), server->getStats());
     }
   }
   return ret.release();
@@ -973,7 +973,7 @@ static RemoteLoggerStats_t* pleaseGetNODFramestreamLoggerStats()
 
   if (t_nodFrameStreamServersInfo.servers) {
     for (const auto& server : *t_nodFrameStreamServersInfo.servers) {
-      ret->emplace(std::make_pair(server->address(), server->getStats()));
+      ret->emplace(server->address(), server->getStats());
     }
   }
   return ret.release();
index 0d237cd750895b0c31fc60ec33dfd806c5e5642b..60116e9ff14119601881ef3c1c616be33829cef9 100644 (file)
@@ -240,7 +240,7 @@ MemRecursorCache::cache_t::const_iterator MemRecursorCache::getEntryUsingECSInde
         /* we have nothing more specific for you */
         break;
       }
-      auto key = std::make_tuple(qname, qtype, boost::none, best);
+      auto key = std::tuple(qname, qtype, boost::none, best);
       auto entry = map.d_map.find(key);
       if (entry == map.d_map.end()) {
         /* ecsIndex is not up-to-date */
@@ -274,7 +274,7 @@ MemRecursorCache::cache_t::const_iterator MemRecursorCache::getEntryUsingECSInde
   }
 
   /* we have nothing specific, let's see if we have a generic one */
-  auto key = std::make_tuple(qname, qtype, boost::none, Netmask());
+  auto key = std::tuple(qname, qtype, boost::none, Netmask());
   auto entry = map.d_map.find(key);
   if (entry != map.d_map.end()) {
     handleServeStaleBookkeeping(now, serveStale, entry);
@@ -543,7 +543,7 @@ void MemRecursorCache::replace(time_t now, const DNSName& qname, const QType qt,
 
   // We only store with a tag if we have an ednsmask and the tag is available
   // We only store an ednsmask if we do not have a tag and we do have a mask.
-  auto key = std::make_tuple(qname, qt.getCode(), ednsmask ? routingTag : boost::none, (ednsmask && !routingTag) ? *ednsmask : Netmask());
+  auto key = std::tuple(qname, qt.getCode(), ednsmask ? routingTag : boost::none, (ednsmask && !routingTag) ? *ednsmask : Netmask());
   bool isNew = false;
   cache_t::iterator stored = lockedShard->d_map.find(key);
   if (stored == lockedShard->d_map.end()) {
@@ -560,7 +560,7 @@ void MemRecursorCache::replace(time_t now, const DNSName& qname, const QType qt,
   if (isNew || stored->d_ttd <= now) {
     /* don't bother building an ecsIndex if we don't have any netmask-specific entries */
     if (!routingTag && ednsmask && !ednsmask->empty()) {
-      auto ecsIndexKey = std::make_tuple(qname, qt.getCode());
+      auto ecsIndexKey = std::tuple(qname, qt.getCode());
       auto ecsIndex = lockedShard->d_ecsIndex.find(ecsIndexKey);
       if (ecsIndex == lockedShard->d_ecsIndex.end()) {
         ecsIndex = lockedShard->d_ecsIndex.insert(ECSIndexEntry(qname, qt.getCode())).first;
index d6825567e77585391178a88fd494014d44526667..2a5b46ae4eb395a13b28b2774a55518936b4ced6 100644 (file)
@@ -878,7 +878,7 @@ bool SyncRes::doSpecialNamesResolve(const DNSName& qname, const QType qtype, con
 //! This is the 'out of band resolver', in other words, the authoritative server
 void SyncRes::AuthDomain::addSOA(std::vector<DNSRecord>& records) const
 {
-  SyncRes::AuthDomain::records_t::const_iterator ziter = d_records.find(std::make_tuple(getName(), QType::SOA));
+  SyncRes::AuthDomain::records_t::const_iterator ziter = d_records.find(std::tuple(getName(), QType::SOA));
   if (ziter != d_records.end()) {
     DNSRecord dr = *ziter;
     dr.d_place = DNSResourceRecord::AUTHORITY;
@@ -958,7 +958,7 @@ int SyncRes::AuthDomain::getRecords(const DNSName& qname, const QType qtype, std
 
   DNSName wcarddomain(qname);
   while (wcarddomain != getName() && wcarddomain.chopOff()) {
-    range = d_records.equal_range(std::make_tuple(g_wildcarddnsname + wcarddomain));
+    range = d_records.equal_range(std::tuple(g_wildcarddnsname + wcarddomain));
     if (range.first == range.second)
       continue;
 
@@ -982,7 +982,7 @@ int SyncRes::AuthDomain::getRecords(const DNSName& qname, const QType qtype, std
   /* Nothing for this name, no wildcard, let's see if there is some NS */
   DNSName nsdomain(qname);
   while (nsdomain.chopOff() && nsdomain != getName()) {
-    range = d_records.equal_range(std::make_tuple(nsdomain, QType::NS));
+    range = d_records.equal_range(std::tuple(nsdomain, QType::NS));
     if (range.first == range.second)
       continue;
 
@@ -1230,22 +1230,22 @@ void SyncRes::clearThrottle()
 
 bool SyncRes::isThrottled(time_t now, const ComboAddress& server, const DNSName& target, QType qtype)
 {
-  return s_throttle.lock()->shouldThrottle(now, std::make_tuple(server, target, qtype));
+  return s_throttle.lock()->shouldThrottle(now, std::tuple(server, target, qtype));
 }
 
 bool SyncRes::isThrottled(time_t now, const ComboAddress& server)
 {
-  return s_throttle.lock()->shouldThrottle(now, std::make_tuple(server, g_rootdnsname, 0));
+  return s_throttle.lock()->shouldThrottle(now, std::tuple(server, g_rootdnsname, 0));
 }
 
 void SyncRes::doThrottle(time_t now, const ComboAddress& server, time_t duration, unsigned int tries)
 {
-  s_throttle.lock()->throttle(now, std::make_tuple(server, g_rootdnsname, 0), duration, tries);
+  s_throttle.lock()->throttle(now, std::tuple(server, g_rootdnsname, 0), duration, tries);
 }
 
 void SyncRes::doThrottle(time_t now, const ComboAddress& server, const DNSName& name, QType qtype, time_t duration, unsigned int tries)
 {
-  s_throttle.lock()->throttle(now, std::make_tuple(server, name, qtype), duration, tries);
+  s_throttle.lock()->throttle(now, std::tuple(server, name, qtype), duration, tries);
 }
 
 uint64_t SyncRes::doDumpThrottleMap(int fd)
index 0b890376550a82d87feadc1384314babdaff17cf..5f96fcd39bac5bde57e1ca03f1884aba8c782361 100644 (file)
@@ -130,7 +130,7 @@ static uint16_t mapTypesToOrder(uint16_t type)
 void pdns::orderAndShuffle(vector<DNSRecord>& rrs, bool includingAdditionals)
 {
   std::stable_sort(rrs.begin(), rrs.end(), [](const DNSRecord& a, const DNSRecord& b) {
-    return std::make_tuple(a.d_place, mapTypesToOrder(a.d_type)) < std::make_tuple(b.d_place, mapTypesToOrder(b.d_type));
+    return std::tuple(a.d_place, mapTypesToOrder(a.d_type)) < std::tuple(b.d_place, mapTypesToOrder(b.d_type));
   });
   shuffle(rrs, includingAdditionals);
 }
index 2da3db7a24b64f05886d6334df7f0c2d70d46440..0e0556056427a2b963fde1c3d892e02a99cfef2e 100644 (file)
@@ -100,12 +100,12 @@ namespace {
 bool
 dedupLessThan(const DNSZoneRecord& a, const DNSZoneRecord &b)
 {
-  return std::make_tuple(a.dr.getContent()->getZoneRepresentation(), a.dr.d_ttl) < std::make_tuple(b.dr.getContent()->getZoneRepresentation(), b.dr.d_ttl);  // XXX SLOW SLOW SLOW
+  return std::tuple(a.dr.getContent()->getZoneRepresentation(), a.dr.d_ttl) < std::tuple(b.dr.getContent()->getZoneRepresentation(), b.dr.d_ttl);  // XXX SLOW SLOW SLOW
 }
 
 bool dedupEqual(const DNSZoneRecord& a, const DNSZoneRecord &b)
 {
-  return std::make_tuple(a.dr.getContent()->getZoneRepresentation(), a.dr.d_ttl) == std::make_tuple(b.dr.getContent()->getZoneRepresentation(), b.dr.d_ttl);  // XXX SLOW SLOW SLOW
+  return std::tuple(a.dr.getContent()->getZoneRepresentation(), a.dr.d_ttl) == std::tuple(b.dr.getContent()->getZoneRepresentation(), b.dr.d_ttl);  // XXX SLOW SLOW SLOW
 }
 }
 
index e4a1ffc8d0ccdb2ccad2def627d0e234259447fe..5029708ee67cc8f52c6003e10200dbbde1b1f23f 100644 (file)
@@ -1052,7 +1052,7 @@ struct SlaveSenderReceiver
   {
     shuffle(dni.di.masters.begin(), dni.di.masters.end(), pdns::dns_random_engine());
     try {
-      return std::make_tuple(dni.di.zone,
+      return {dni.di.zone,
                              *dni.di.masters.begin(),
                              d_resolver.sendResolve(*dni.di.masters.begin(),
                                                     dni.localaddr,
@@ -1060,7 +1060,7 @@ struct SlaveSenderReceiver
                                                     QType::SOA,
                                                     nullptr,
                                                     dni.dnssecOk, dni.tsigkeyname, dni.tsigalgname, dni.tsigsecret)
-        );
+      };
     }
     catch(PDNSException& e) {
       throw runtime_error("While attempting to query freshness of '"+dni.di.zone.toLogString()+"': "+e.reason);
index 7836e3c950efa0a41132292552de47b7562eef64..3e54e682d81b5fdf6776d24acb474da0341aaa90 100644 (file)
@@ -121,7 +121,7 @@ public:
       if (it == d_dnsnameqtyperings.end()) {
        throw runtime_error("Attempting to account to nonexistent dnsname+qtype ring '"+std::string(name)+"'");
       }
-      it->second.lock()->account(std::make_tuple(dnsname, qtype));
+      it->second.lock()->account(std::tuple(dnsname, qtype));
     }
   }
 
index b11219a4a50100d173f02f08b579d60351b7e609..4a13aafad05004df111b5ea42c6b41fb43d5a5c2 100644 (file)
@@ -153,7 +153,7 @@ public:
         d_end = range.second;
       }
       else {
-        auto range = idx.equal_range(std::make_tuple(qdomain, qtype.getCode()));
+        auto range = idx.equal_range(std::tuple(qdomain, qtype.getCode()));
         d_iter = range.first;
         d_end = range.second;
       }
@@ -200,7 +200,7 @@ public:
   bool getDomainMetadata(const DNSName& name, const std::string& kind, std::vector<std::string>& meta) override
   {
     const auto& idx = boost::multi_index::get<OrderedNameKindTag>(s_metadata.at(d_backendId));
-    auto it = idx.find(std::make_tuple(name, kind));
+    auto it = idx.find(std::tuple(name, kind));
     if (it == idx.end()) {
       /* funnily enough, we are expected to return true even though we might not know that zone */
       return true;
@@ -213,7 +213,7 @@ public:
   bool setDomainMetadata(const DNSName& name, const std::string& kind, const std::vector<std::string>& meta) override
   {
     auto& idx = boost::multi_index::get<OrderedNameKindTag>(s_metadata.at(d_backendId));
-    auto it = idx.find(std::make_tuple(name, kind));
+    auto it = idx.find(std::tuple(name, kind));
     if (it == idx.end()) {
       s_metadata.at(d_backendId).insert(SimpleMetaData(name, kind, meta));
       return true;
@@ -258,7 +258,7 @@ public:
       }
 
       auto& idx = records->get<OrderedNameTypeTag>();
-      auto range = idx.equal_range(std::make_tuple(best, QType::SOA));
+      auto range = idx.equal_range(std::tuple(best, QType::SOA));
       if (range.first == range.second) {
         return false;
       }
@@ -1155,7 +1155,7 @@ BOOST_AUTO_TEST_CASE(test_multi_backends_metadata) {
 
     {
       // check that it has not been updated in the second backend
-      const auto& it = SimpleBackend::s_metadata[2].find(std::make_tuple(DNSName("powerdns.org."), "test-data-b"));
+      const auto& it = SimpleBackend::s_metadata[2].find(std::tuple(DNSName("powerdns.org."), "test-data-b"));
       BOOST_REQUIRE(it != SimpleBackend::s_metadata[2].end());
       BOOST_REQUIRE_EQUAL(it->d_values.size(), 2U);
       BOOST_CHECK_EQUAL(it->d_values.at(0), "value1");
index eb96ca6bd426887a2044dded263b94fc6b1d41e6..decc2f3f64f8c7cc4626294447f1eeafc7ffc66a 100644 (file)
@@ -118,7 +118,7 @@ static std::string getHashFromNSEC3(const DNSName& qname, const NSEC3RecordConte
     return result;
   }
 
-  auto key = std::make_tuple(qname, nsec3.d_salt, nsec3.d_iterations);
+  auto key = std::tuple(qname, nsec3.d_salt, nsec3.d_iterations);
   auto iter = cache.find(key);
   if (iter != cache.end())
   {