mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-21 14:47:03 +01:00
g10: Optimize key iteration.
* g10/getkey.c (get_best_pubkey_byname): Use the node returned by 'getkey_next' instead of doing another lookup. Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
parent
d20107f6da
commit
12834e84ac
@ -1593,9 +1593,9 @@ get_best_pubkey_byname (ctrl_t ctrl, GETKEY_CTX *retctx, PKT_public_key *pk,
|
||||
{
|
||||
/* Rank results and return only the most relevant key. */
|
||||
struct pubkey_cmp_cookie best = { 0 }, new;
|
||||
while (getkey_next (ctx, &new.key, NULL) == 0)
|
||||
KBNODE new_keyblock;
|
||||
while (getkey_next (ctx, &new.key, &new_keyblock) == 0)
|
||||
{
|
||||
KBNODE new_keyblock = get_pubkeyblock (pk_keyid (&new.key));
|
||||
int diff = pubkey_cmp (ctrl, name, &best, &new, new_keyblock);
|
||||
release_kbnode (new_keyblock);
|
||||
if (diff < 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user