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.
This commit is contained in:
Andre Heinecke 2019-11-01 12:04:41 +01:00
parent 266e05eee8
commit 174caaa6f5
No known key found for this signature in database
GPG Key ID: 2978E9D40CBABA5C

View File

@ -753,8 +753,12 @@ const char *UserID::remark(const Key &remarker, Error &err) const
return nullptr; return nullptr;
} }
if (!(parent().keyListMode() & GPGME_KEYLIST_MODE_SIG_NOTATIONS) || if (key->protocol != GPGME_PROTOCOL_OpenPGP) {
!(parent().keyListMode() & GPGME_KEYLIST_MODE_SIGS)) { 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); err = Error::fromCode(GPG_ERR_NO_DATA);
return nullptr; return nullptr;
} }