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/extra/sqlite.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/extra/sqlite.cpp')
-rw-r--r-- | modules/extra/sqlite.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/modules/extra/sqlite.cpp b/modules/extra/sqlite.cpp index d234066a0..36bafae4c 100644 --- a/modules/extra/sqlite.cpp +++ b/modules/extra/sqlite.cpp @@ -113,9 +113,9 @@ public: SQLiteServices.clear(); } - void OnReload(Configuration::Conf *conf) override + void OnReload(Configuration::Conf &conf) override { - Configuration::Block *config = conf->GetModule(this); + Configuration::Block &config = conf.GetModule(this); for (std::map<Anope::string, SQLiteService *>::iterator it = this->SQLiteServices.begin(); it != this->SQLiteServices.end();) { @@ -124,8 +124,8 @@ public: int i, num; ++it; - for (i = 0, num = config->CountBlock("sqlite"); i < num; ++i) - if (config->GetBlock("sqlite", i)->Get<const Anope::string>("name", "sqlite/main") == cname) + for (i = 0, num = Config->CountBlock("sqlite"); i < num; ++i) + if (config.GetBlock("sqlite", i).Get<const Anope::string>("name", "sqlite/main") == cname) break; if (i == num) @@ -137,14 +137,14 @@ public: } } - for (int i = 0; i < config->CountBlock("sqlite"); ++i) + for (int i = 0; i < Config->CountBlock("sqlite"); ++i) { - Configuration::Block *block = config->GetBlock("sqlite", i); - Anope::string connname = block->Get<const Anope::string>("name", "sqlite/main"); + Configuration::Block &block = config.GetBlock("sqlite", i); + Anope::string connname = block.Get<const Anope::string>("name", "sqlite/main"); if (this->SQLiteServices.find(connname) == this->SQLiteServices.end()) { - auto database = Anope::ExpandData(block->Get<const Anope::string>("database", "anope")); + auto database = Anope::ExpandData(block.Get<const Anope::string>("database", "anope")); try { auto *ss = new SQLiteService(this, connname, database); |