diff --git a/pdns/recursordist/recursor_cache.cc b/pdns/recursordist/recursor_cache.cc index 0c240e71ed9a..9bfdb010fd10 100644 --- a/pdns/recursordist/recursor_cache.cc +++ b/pdns/recursordist/recursor_cache.cc @@ -578,7 +578,7 @@ bool MemRecursorCache::replace(CacheEntry&& entry) lockedShard->d_cachecachevalid = false; entry.d_submitted = false; - if (lockedShard->d_map.insert(entry).second) { + if (lockedShard->d_map.emplace(std::move(entry)).second) { shard.incEntriesCount(); return true; } diff --git a/pdns/recursordist/recursor_cache.hh b/pdns/recursordist/recursor_cache.hh index 50c637afdf89..596eeb85ad70 100644 --- a/pdns/recursordist/recursor_cache.hh +++ b/pdns/recursordist/recursor_cache.hh @@ -21,7 +21,6 @@ */ #pragma once #include -#include #include "dns.hh" #include "qtype.hh" #include "misc.hh" @@ -63,7 +62,7 @@ public: [[nodiscard]] pair stats(); [[nodiscard]] size_t ecsIndexSize(); - size_t getRecords(size_t howmany, size_t maxsize, std::string& ret); + size_t getRecords(size_t perShard, size_t maxSize, std::string& ret); size_t putRecords(const std::string& pbuf); using OptTag = boost::optional;