emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master fea8c7d: Tweak previous gnutls change for efficienc


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master fea8c7d: Tweak previous gnutls change for efficiency
Date: Sun, 24 Jun 2018 15:22:14 -0400 (EDT)

branch: master
commit fea8c7d181babe6de7daedfef07b291f8dda2322
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Tweak previous gnutls change for efficiency
    
    * src/gnutls.c (Fgnutls_peer_status): Minor optimisation to avoid
    computing the topmost certificate twice.
---
 src/gnutls.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/gnutls.c b/src/gnutls.c
index 5a17847..9295692 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -1268,18 +1268,16 @@ The return value is a property list with top-level keys 
:warnings and
     {
       Lisp_Object certs = Qnil;
 
-      /* Return the host certificate in its own element for
-        compatibility reasons. */
-      result = nconc2 (result, list2
-                      (intern (":certificate"),
-                       gnutls_certificate_details (XPROCESS 
(proc)->gnutls_certificates[0])));
-
       /* Return all the certificates in a list. */
       for (int i = 0; i < XPROCESS (proc)->gnutls_certificates_length; i++)
        certs = nconc2 (certs, list1 (gnutls_certificate_details
                                      (XPROCESS 
(proc)->gnutls_certificates[i])));
 
       result = nconc2 (result, list2 (intern (":certificates"), certs));
+
+      /* Return the host certificate in its own element for
+        compatibility reasons. */
+      result = nconc2 (result, list2 (intern (":certificate"), XCAR (certs)));
     }
 
   state = XPROCESS (proc)->gnutls_state;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]