diff options
author | Sadie Powell <sadie@witchery.services> | 2025-03-02 14:51:02 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2025-03-02 15:27:47 +0000 |
commit | f9911dde529adf3dc03f4f14bbd70756ac2f665c (patch) | |
tree | 7c720e4f82fdb30b7d8a22fc0809f50bc862fae3 /modules/dns.cpp | |
parent | a5e5eb5eb084e8343260ce7bc26ea86798f64fe1 (diff) |
Return references instead of pointers from the config system.
We used to return NULL from these methods but now we return an empty
block so this can never actually be null now.
Diffstat (limited to 'modules/dns.cpp')
-rw-r--r-- | modules/dns.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/modules/dns.cpp b/modules/dns.cpp index f94854058..372c22d1e 100644 --- a/modules/dns.cpp +++ b/modules/dns.cpp @@ -1045,23 +1045,23 @@ public: } } - void OnReload(Configuration::Conf *conf) override + void OnReload(Configuration::Conf &conf) override { - Configuration::Block *block = conf->GetModule(this); + Configuration::Block &block = conf.GetModule(this); - nameserver = block->Get<const Anope::string>("nameserver", "127.0.0.1"); - timeout = block->Get<time_t>("timeout", "5"); - ip = block->Get<const Anope::string>("ip", "0.0.0.0"); - port = block->Get<int>("port", "53"); - admin = block->Get<const Anope::string>("admin", "admin@example.com"); - nameservers = block->Get<const Anope::string>("nameservers", "ns1.example.com"); - refresh = block->Get<int>("refresh", "3600"); + nameserver = block.Get<const Anope::string>("nameserver", "127.0.0.1"); + timeout = block.Get<time_t>("timeout", "5"); + ip = block.Get<const Anope::string>("ip", "0.0.0.0"); + port = block.Get<int>("port", "53"); + admin = block.Get<const Anope::string>("admin", "admin@example.com"); + nameservers = block.Get<const Anope::string>("nameservers", "ns1.example.com"); + refresh = block.Get<int>("refresh", "3600"); - for (int i = 0; i < block->CountBlock("notify"); ++i) + for (int i = 0; i < block.CountBlock("notify"); ++i) { - Configuration::Block *n = block->GetBlock("notify", i); - Anope::string nip = n->Get<Anope::string>("ip"); - short nport = n->Get<short>("port"); + Configuration::Block &n = block.GetBlock("notify", i); + Anope::string nip = n.Get<Anope::string>("ip"); + short nport = n.Get<short>("port"); notify.emplace_back(nip, nport); } |