aboutsummaryrefslogtreecommitdiff
path: root/src/bench/addrman.cpp
diff options
context:
space:
mode:
authorAmiti Uttarwar <amiti@uttarwar.org>2021-09-10 18:16:37 -0600
committerAmiti Uttarwar <amiti@uttarwar.org>2021-09-28 22:21:10 -0400
commitdd8f7f250095e58bbf4cd4effb481b52143bd1ed (patch)
tree04068c2a49362c5ab7958fcb8bc268c55f5fc59d /src/bench/addrman.cpp
parent3c263d3f63c3598954ee2b65a0e721e3c22e52f8 (diff)
downloadbitcoin-dd8f7f250095e58bbf4cd4effb481b52143bd1ed.tar.xz
scripted-diff: Rename CAddrMan to AddrMan
-BEGIN VERIFY SCRIPT- git grep -l CAddrMan src/ test/ | xargs sed -i 's/CAddrMan/AddrMan/g' -END VERIFY SCRIPT-
Diffstat (limited to 'src/bench/addrman.cpp')
-rw-r--r--src/bench/addrman.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/bench/addrman.cpp b/src/bench/addrman.cpp
index b4c2e35f42..d6834a239b 100644
--- a/src/bench/addrman.cpp
+++ b/src/bench/addrman.cpp
@@ -53,14 +53,14 @@ static void CreateAddresses()
}
}
-static void AddAddressesToAddrMan(CAddrMan& addrman)
+static void AddAddressesToAddrMan(AddrMan& addrman)
{
for (size_t source_i = 0; source_i < NUM_SOURCES; ++source_i) {
addrman.Add(g_addresses[source_i], g_sources[source_i]);
}
}
-static void FillAddrMan(CAddrMan& addrman)
+static void FillAddrMan(AddrMan& addrman)
{
CreateAddresses();
@@ -74,14 +74,14 @@ static void AddrManAdd(benchmark::Bench& bench)
CreateAddresses();
bench.run([&] {
- CAddrMan addrman{/* asmap */ std::vector<bool>(), /* deterministic */ false, /* consistency_check_ratio */ 0};
+ AddrMan addrman{/* asmap */ std::vector<bool>(), /* deterministic */ false, /* consistency_check_ratio */ 0};
AddAddressesToAddrMan(addrman);
});
}
static void AddrManSelect(benchmark::Bench& bench)
{
- CAddrMan addrman(/* asmap */ std::vector<bool>(), /* deterministic */ false, /* consistency_check_ratio */ 0);
+ AddrMan addrman(/* asmap */ std::vector<bool>(), /* deterministic */ false, /* consistency_check_ratio */ 0);
FillAddrMan(addrman);
@@ -93,7 +93,7 @@ static void AddrManSelect(benchmark::Bench& bench)
static void AddrManGetAddr(benchmark::Bench& bench)
{
- CAddrMan addrman(/* asmap */ std::vector<bool>(), /* deterministic */ false, /* consistency_check_ratio */ 0);
+ AddrMan addrman(/* asmap */ std::vector<bool>(), /* deterministic */ false, /* consistency_check_ratio */ 0);
FillAddrMan(addrman);
@@ -105,7 +105,7 @@ static void AddrManGetAddr(benchmark::Bench& bench)
static void AddrManAddThenGood(benchmark::Bench& bench)
{
- auto markSomeAsGood = [](CAddrMan& addrman) {
+ auto markSomeAsGood = [](AddrMan& addrman) {
for (size_t source_i = 0; source_i < NUM_SOURCES; ++source_i) {
for (size_t addr_i = 0; addr_i < NUM_ADDRESSES_PER_SOURCE; ++addr_i) {
addrman.Good(g_addresses[source_i][addr_i]);
@@ -117,12 +117,12 @@ static void AddrManAddThenGood(benchmark::Bench& bench)
bench.run([&] {
// To make the benchmark independent of the number of evaluations, we always prepare a new addrman.
- // This is necessary because CAddrMan::Good() method modifies the object, affecting the timing of subsequent calls
+ // This is necessary because AddrMan::Good() method modifies the object, affecting the timing of subsequent calls
// to the same method and we want to do the same amount of work in every loop iteration.
//
// This has some overhead (exactly the result of AddrManAdd benchmark), but that overhead is constant so improvements in
- // CAddrMan::Good() will still be noticeable.
- CAddrMan addrman(/* asmap */ std::vector<bool>(), /* deterministic */ false, /* consistency_check_ratio */ 0);
+ // AddrMan::Good() will still be noticeable.
+ AddrMan addrman(/* asmap */ std::vector<bool>(), /* deterministic */ false, /* consistency_check_ratio */ 0);
AddAddressesToAddrMan(addrman);
markSomeAsGood(addrman);