]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rename pdns::shuffle to pdns::shufleRecords, as suggested by @rgacogne
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 25 Oct 2024 09:17:28 +0000 (11:17 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 16 Dec 2024 10:28:53 +0000 (11:28 +0100)
pdns/recursordist/pdns_recursor.cc
pdns/recursordist/syncres.cc
pdns/recursordist/test-shuffle_cc.cc
pdns/shuffle.cc
pdns/shuffle.hh
pdns/speedtest.cc

index e28d8f6f8305d82c8e850e399f11bd0ca50c68f8..4055aafa739f175d2a37d32c7f0a4d1f28ab5119 100644 (file)
@@ -1509,7 +1509,7 @@ void startDoResolve(void* arg) // NOLINT(readability-function-cognitive-complexi
       }
 
       if (!ret.empty()) {
-        pdns::dedup(ret);
+        pdns::dedupRecords(ret);
         pdns::orderAndShuffle(ret, false);
         if (auto listToSort = luaconfsLocal->sortlist.getOrderCmp(comboWriter->d_source)) {
           stable_sort(ret.begin(), ret.end(), *listToSort);
index 2681379f202060c415be78a9efe9510015745ad8..9202e3a103f24ead81e63538859914186229049e 100644 (file)
@@ -4446,7 +4446,7 @@ void SyncRes::sanitizeRecordsPass2(const std::string& prefix, LWResult& lwr, con
     }
     lwr.d_records = std::move(vec);
   }
-  if (auto count = pdns::dedup(lwr.d_records); count > 0) {
+  if (auto count = pdns::dedupRecords(lwr.d_records); count > 0) {
     LOG(prefix << qname << ": Removed " << count << " duplicate records from response received from " << auth << endl);
   }
 }
index 469cc2820f46880c236091a73719cbeae02c5822..60896b46f119715eaffbdcd9346748860816a654 100644 (file)
@@ -40,16 +40,16 @@ BOOST_AUTO_TEST_CASE(test_simple)
   auto* address = &list;
   addRecordToList(list, DNSName("foo"), QType::A, "1.2.3.4");
   addRecordToList(list, DNSName("foo2"), QType::A, "1.2.3.4");
-  auto dups = pdns::dedup(list);
+  auto dups = pdns::dedupRecords(list);
   BOOST_CHECK_EQUAL(dups, 0U);
   BOOST_CHECK_EQUAL(list.size(), 2U);
   addRecordToList(list, DNSName("foo"), QType::A, "1.2.3.4");
-  dups = pdns::dedup(list);
+  dups = pdns::dedupRecords(list);
   BOOST_CHECK_EQUAL(dups, 1U);
   BOOST_CHECK_EQUAL(list.size(), 2U);
   addRecordToList(list, DNSName("Foo"), QType::A, "1.2.3.4");
   addRecordToList(list, DNSName("FoO"), QType::A, "1.2.3.4", DNSResourceRecord::ADDITIONAL, 999);
-  dups = pdns::dedup(list);
+  dups = pdns::dedupRecords(list);
   BOOST_CHECK_EQUAL(dups, 2U);
   BOOST_CHECK_EQUAL(list.size(), 2U);
   BOOST_CHECK_EQUAL(address, &list);
index 15eee7b6f4ec64a8504a83d1aaaa4c5d8847e902..fae7a4a493ddd98c97bcd376e7c00e58587e7819 100644 (file)
@@ -141,7 +141,7 @@ void pdns::orderAndShuffle(vector<DNSRecord>& rrs, bool includingAdditionals)
   shuffle(rrs, includingAdditionals);
 }
 
-unsigned int pdns::dedup(vector<DNSRecord>& rrs)
+unsigned int pdns::dedupRecords(vector<DNSRecord>& rrs)
 {
   // This function tries to avoid unneccesary work
   // First a vector with zero or one element does not need dedupping
index 6e9b7525b36974ab09cdf26f5e976b9f99aa78d7..e0a7f5ea46ee60642dcd62500fba7113367b690a 100644 (file)
@@ -29,5 +29,5 @@ namespace pdns
 {
 void shuffle(std::vector<DNSZoneRecord>& rrs);
 void orderAndShuffle(std::vector<DNSRecord>& rrs, bool includingAdditionals);
-unsigned int dedup(std::vector<DNSRecord>& rrs);
+unsigned int dedupRecords(std::vector<DNSRecord>& rrs);
 }
index 2c77337bc72dcf93a028868ce6c7ad853362d6d5..c087bc69f794f9a81e0d38d03ef44cbdaf2441ba 100644 (file)
@@ -1213,7 +1213,7 @@ struct DedupRecordsTest
     }
 
     if (d_dedup) {
-      pdns::dedup(vec);
+      pdns::dedupRecords(vec);
     }
   }