summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-10-13 14:19:22 +0200
committerJustus Winter <justus@sequoia-pgp.org>2020-10-13 14:19:22 +0200
commitc320927784cc2cf179fd899b32944efad6fc2a98 (patch)
treea0043418d231f4c4cda6e6849b0e06869e899ed9
parentd8fe9dcee161de25139176a4dfd82da0fc0d0a04 (diff)
openpgp: Avoid allocation if nothing has to be done.
-rw-r--r--openpgp/src/packet/signature.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/openpgp/src/packet/signature.rs b/openpgp/src/packet/signature.rs
index 3ecd43dd..e5fe662d 100644
--- a/openpgp/src/packet/signature.rs
+++ b/openpgp/src/packet/signature.rs
@@ -2062,6 +2062,10 @@ impl crate::packet::Signature {
/// change the serialized representation of the signature as a
/// side-effect of verifying the signature.
pub fn add_missing_issuers(&mut self) -> Result<()> {
+ if self.additional_issuers.is_empty() {
+ return Ok(());
+ }
+
let issuers = self.get_issuers();
for id in std::mem::replace(&mut self.additional_issuers,
Vec::with_capacity(0)) {