diff options
author | saturneric <[email protected]> | 2024-01-18 05:32:25 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-01-18 05:32:25 +0000 |
commit | 38e4a656dbdd14cf7a6a91cda6c814b5290acd93 (patch) | |
tree | 33f614f861dec8fef4ea456dda26abab2e3329f5 /src/core/module/Module.cpp | |
parent | fix: improve code quality, docs and ci files (diff) | |
download | GpgFrontend-38e4a656dbdd14cf7a6a91cda6c814b5290acd93.tar.gz GpgFrontend-38e4a656dbdd14cf7a6a91cda6c814b5290acd93.zip |
fix: slove codacy issues
Diffstat (limited to 'src/core/module/Module.cpp')
-rw-r--r-- | src/core/module/Module.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/core/module/Module.cpp b/src/core/module/Module.cpp index c37b2262..9076dc2c 100644 --- a/src/core/module/Module.cpp +++ b/src/core/module/Module.cpp @@ -40,8 +40,7 @@ class Module::Impl { Impl(ModuleRawPtr m_ptr, ModuleIdentifier id, ModuleVersion version, ModuleMetaData meta_data) - : gpc_(nullptr), - m_ptr_(m_ptr), + : m_ptr_(m_ptr), identifier_(std::move(id)), version_(std::move(version)), meta_data_(std::move(meta_data)) {} @@ -49,7 +48,7 @@ class Module::Impl { auto GetChannel() -> int { return get_gpc()->GetChannel(m_ptr_); } auto GetDefaultChannel() -> int { - return get_gpc()->GetDefaultChannel(m_ptr_); + return GlobalModuleContext::GetDefaultChannel(m_ptr_); } auto GetTaskRunner() -> std::optional<TaskRunnerPtr> { @@ -67,7 +66,7 @@ class Module::Impl { void SetGPC(GlobalModuleContext* gpc) { gpc_ = gpc; } private: - GlobalModuleContext* gpc_; + GlobalModuleContext* gpc_{}; Module* m_ptr_; const ModuleIdentifier identifier_; const ModuleVersion version_; @@ -82,7 +81,7 @@ class Module::Impl { }; Module::Module(ModuleIdentifier id, ModuleVersion version, - ModuleMetaData meta_data) + const ModuleMetaData& meta_data) : p_(SecureCreateUniqueObject<Impl>(this, id, version, meta_data)) {} Module::~Module() = default; |