aboutsummaryrefslogtreecommitdiffstats
path: root/lang/cpp/src
diff options
context:
space:
mode:
authorAndre Heinecke <[email protected]>2019-11-01 11:04:41 +0000
committerAndre Heinecke <[email protected]>2019-11-01 11:04:41 +0000
commit174caaa6f53e1125724a47dad3a5c991298aee6d (patch)
tree5686931b39bfa100c3966c838c18ff69ac1d0775 /lang/cpp/src
parentcpp: Fix adding duplicated sigs on multiple uids (diff)
downloadgpgme-174caaa6f53e1125724a47dad3a5c991298aee6d.tar.gz
gpgme-174caaa6f53e1125724a47dad3a5c991298aee6d.zip
cpp: Minor optimization in remark lookup
* lang/cpp/src/key.cpp (UserID::remark): Use C-API. -- The other parts of that function already use the C API so we can also avoid function calls for the keyListMode.
Diffstat (limited to 'lang/cpp/src')
-rw-r--r--lang/cpp/src/key.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lang/cpp/src/key.cpp b/lang/cpp/src/key.cpp
index eb7a5030..e2d91a10 100644
--- a/lang/cpp/src/key.cpp
+++ b/lang/cpp/src/key.cpp
@@ -753,8 +753,12 @@ const char *UserID::remark(const Key &remarker, Error &err) const
return nullptr;
}
- if (!(parent().keyListMode() & GPGME_KEYLIST_MODE_SIG_NOTATIONS) ||
- !(parent().keyListMode() & GPGME_KEYLIST_MODE_SIGS)) {
+ if (key->protocol != GPGME_PROTOCOL_OpenPGP) {
+ return nullptr;
+ }
+
+ if (!(key->keylist_mode & GPGME_KEYLIST_MODE_SIG_NOTATIONS) ||
+ !(key->keylist_mode & GPGME_KEYLIST_MODE_SIGS)) {
err = Error::fromCode(GPG_ERR_NO_DATA);
return nullptr;
}