From: Lars Ingebrigtsen Date: Sun, 24 Jun 2018 19:21:56 +0000 (+0200) Subject: Tweak previous gnutls change for efficiency X-Git-Tag: emacs-27.0.90~4770 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fea8c7d181babe6de7daedfef07b291f8dda2322;p=emacs.git Tweak previous gnutls change for efficiency * src/gnutls.c (Fgnutls_peer_status): Minor optimisation to avoid computing the topmost certificate twice. --- diff --git a/src/gnutls.c b/src/gnutls.c index 5a178472ceb..92956923db3 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;