tweaks to break out of unnecessary extra key loops if a valid key is found
authorJameson Rollins <jrollins@finestructure.net>
Sat, 25 Dec 2010 16:57:07 +0000 (11:57 -0500)
committerJameson Rollins <jrollins@finestructure.net>
Sat, 25 Dec 2010 16:57:07 +0000 (11:57 -0500)
Crypt/Monkeysphere/MSVA.pm

index 86be5dade554af48bbdef7131d5784bc5e71beb7..b576f981c568dfe36f1661c0ec8da6aa301e50df 100755 (executable)
                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;
            }
          }
        }
+       last if ($foundvalid);
       }
-      if ($lastloop) {
+      if ($lastloop || $foundvalid) {
        last;
       } else {
        if (!$foundvalid) {