Commit 62ef6f94 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Fix removal of subkeys belonging to a key from the key cache

parent adb270cd
......@@ -805,8 +805,11 @@ void KeyCache::remove(const Key &key)
if (const char *keyid = subkey.keyID()) {
const auto range = std::equal_range(d->by.subkeyid.begin(), d->by.subkeyid.end(), keyid,
const auto range2 = std::equal_range(range.first, range.second, fpr, _detail::ByKeyID<std::less>());
d->by.subkeyid.erase(range2.first, range2.second);
const auto it = std::remove_if(range.first, range.second,
[fpr] (const Subkey &subkey) {
return !qstricmp(fpr, subkey.parent().primaryFingerprint());
d->by.subkeyid.erase(it, range.second);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment