diff options
author | Andre Heinecke <[email protected]> | 2019-11-01 11:04:41 +0000 |
---|---|---|
committer | Andre Heinecke <[email protected]> | 2019-11-01 11:04:41 +0000 |
commit | 174caaa6f53e1125724a47dad3a5c991298aee6d (patch) | |
tree | 5686931b39bfa100c3966c838c18ff69ac1d0775 /lang/cpp/src/key.cpp | |
parent | cpp: Fix adding duplicated sigs on multiple uids (diff) | |
download | gpgme-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/key.cpp')
-rw-r--r-- | lang/cpp/src/key.cpp | 8 |
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; } |