From d0602f09564d3d200b20e83a977315134ced842e Mon Sep 17 00:00:00 2001 From: saturneric Date: Sun, 3 Dec 2023 05:01:27 -0800 Subject: fix: slove issues in key/subkey generation --- src/core/function/gpg/GpgKeyGetter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/core/function/gpg/GpgKeyGetter.cpp') diff --git a/src/core/function/gpg/GpgKeyGetter.cpp b/src/core/function/gpg/GpgKeyGetter.cpp index 5215f34b..cad2d884 100644 --- a/src/core/function/gpg/GpgKeyGetter.cpp +++ b/src/core/function/gpg/GpgKeyGetter.cpp @@ -82,7 +82,7 @@ class GpgKeyGetter::Impl : public SingletonFunctionObject { auto keys_list = std::make_unique(); for (const auto& [key, value] : keys_cache_) { - keys_list->push_back(value.Copy()); + keys_list->push_back(value); } return keys_list; } @@ -140,7 +140,7 @@ class GpgKeyGetter::Impl : public SingletonFunctionObject { // get the lock std::lock_guard lock(ctx_mutex_); auto keys_copy = std::make_unique(); - for (const auto& key : *keys) keys_copy->emplace_back(key.Copy()); + for (const auto& key : *keys) keys_copy->emplace_back(key); return keys_copy; } @@ -148,7 +148,7 @@ class GpgKeyGetter::Impl : public SingletonFunctionObject { // get the lock std::lock_guard lock(ctx_mutex_); auto keys_copy = std::make_unique(); - for (const auto& key : *keys) keys_copy->emplace_back(key.Copy()); + for (const auto& key : *keys) keys_copy->emplace_back(key); return keys_copy; } @@ -189,7 +189,7 @@ class GpgKeyGetter::Impl : public SingletonFunctionObject { if (keys_cache_.find(key_id) != keys_cache_.end()) { std::lock_guard lock(ctx_mutex_); // return a copy of the key in cache - return keys_cache_[key_id].Copy(); + return keys_cache_[key_id]; } // return a bad key -- cgit v1.2.3