From: Jameson Rollins Date: Sat, 25 Dec 2010 16:57:07 +0000 (-0500) Subject: tweaks to break out of unnecessary extra key loops if a valid key is found X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=58392cd1a084f575c93c141c4c8250bd3d843c64;p=monkeysphere-validation-agent.git tweaks to break out of unnecessary extra key loops if a valid key is found --- diff --git a/Crypt/Monkeysphere/MSVA.pm b/Crypt/Monkeysphere/MSVA.pm index 86be5da..b576f98 100755 --- a/Crypt/Monkeysphere/MSVA.pm +++ b/Crypt/Monkeysphere/MSVA.pm @@ -798,6 +798,7 @@ msvalog('verbose', "...and is fully valid!\n"); $ret->{valid} = JSON::true; $ret->{message} = sprintf('Successfully validated "%s" through the OpenPGP Web of Trust.', $uid); + last; } else { msvalog('verbose', "...but is not fully valid.\n"); push(@subvalid_key_fprs, { fpr => $subkey->fingerprint, val => $validity }) if $lastloop; @@ -805,8 +806,9 @@ } } } + last if ($foundvalid); } - if ($lastloop) { + if ($lastloop || $foundvalid) { last; } else { if (!$foundvalid) {