From 07c49e517ec577a2624aa139404f0b7d76fe30e2 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Tue, 26 Jun 2018 22:31:10 -0700 Subject: Only grab the name entry count when needed --- openssl/src/x509/mod.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'openssl') diff --git a/openssl/src/x509/mod.rs b/openssl/src/x509/mod.rs index 0b6c6b3d..3cfb0856 100644 --- a/openssl/src/x509/mod.rs +++ b/openssl/src/x509/mod.rs @@ -847,8 +847,6 @@ impl<'a> Iterator for X509NameEntries<'a> { fn next(&mut self) -> Option<&'a X509NameEntryRef> { unsafe { - let entry_count = ffi::X509_NAME_entry_count(self.name.as_ptr()); - match self.nid { Some(nid) => { // There is a `Nid` specified to search for @@ -861,7 +859,7 @@ impl<'a> Iterator for X509NameEntries<'a> { None => { // Iterate over all `Nid`s self.loc += 1; - if self.loc >= entry_count { + if self.loc >= ffi::X509_NAME_entry_count(self.name.as_ptr()) { return None; } } -- cgit v1.2.3