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/enc_argon2.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/enc_argon2.cpp')
-rw-r--r-- | modules/extra/enc_argon2.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/modules/extra/enc_argon2.cpp b/modules/extra/enc_argon2.cpp index 8d6f27d9b..81d052c0c 100644 --- a/modules/extra/enc_argon2.cpp +++ b/modules/extra/enc_argon2.cpp @@ -154,15 +154,15 @@ public: }); } - void OnReload(Configuration::Conf *conf) override + void OnReload(Configuration::Conf &conf) override { - const auto *block = Config->GetModule(this); - this->defaultprovider = GetAlgorithm(block->Get<const Anope::string>("algorithm", "argon2id")); - Argon2Context::memory_cost = block->Get<uint32_t>("memory_cost", "131072"); - Argon2Context::time_cost = block->Get<uint32_t>("time_cost", "3"); - Argon2Context::parallelism = block->Get<uint32_t>("parallelism", "1"); - Argon2Context::hash_length = block->Get<uint32_t>("hash_length", "32"); - Argon2Context::salt_length = block->Get<uint32_t>("salt_length", "32"); + const auto &block = Config->GetModule(this); + this->defaultprovider = GetAlgorithm(block.Get<const Anope::string>("algorithm", "argon2id")); + Argon2Context::memory_cost = block.Get<uint32_t>("memory_cost", "131072"); + Argon2Context::time_cost = block.Get<uint32_t>("time_cost", "3"); + Argon2Context::parallelism = block.Get<uint32_t>("parallelism", "1"); + Argon2Context::hash_length = block.Get<uint32_t>("hash_length", "32"); + Argon2Context::salt_length = block.Get<uint32_t>("salt_length", "32"); } EventReturn OnEncrypt(const Anope::string &src, Anope::string &dest) override |