diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2018-06-24 21:21:56 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2018-06-24 21:21:56 +0200 |
commit | fea8c7d181babe6de7daedfef07b291f8dda2322 (patch) | |
tree | 00aa225bb2255d402b5ecd2423443929e643dcd5 /src/gnutls.c | |
parent | c8745d95cffc348da7ae1e7f6a6c07ec2f4b2f3f (diff) | |
download | emacs-fea8c7d181babe6de7daedfef07b291f8dda2322.tar.gz emacs-fea8c7d181babe6de7daedfef07b291f8dda2322.tar.bz2 emacs-fea8c7d181babe6de7daedfef07b291f8dda2322.zip |
Tweak previous gnutls change for efficiency
* src/gnutls.c (Fgnutls_peer_status): Minor optimisation to avoid
computing the topmost certificate twice.
Diffstat (limited to 'src/gnutls.c')
-rw-r--r-- | src/gnutls.c | 10 |
1 files changed, 4 insertions, 6 deletions
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; |