Skip to content

Commit 9741eaf

Browse files
gpsheadpicnixz
andauthored
simplify C conditional syntax
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
1 parent 8a42346 commit 9741eaf

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

‎Modules/_ssl.c‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2007,12 +2007,9 @@ _ssl__SSLSocket_get_unverified_chain_impl(PySSLSocket *self)
20072007
else if (chain == NULL) {
20082008
Py_RETURN_NONE;
20092009
}
2010-
if (chain == NULL) {
2011-
retval = PyList_New(0);
2012-
}
2013-
else {
2014-
retval = _PySSL_CertificateFromX509Stack(self->ctx->state, chain, 1);
2015-
}
2010+
retval = chain == NULL
2011+
? PyList_New(0)
2012+
: _PySSL_CertificateFromX509Stack(self->ctx->state, chain, 1);
20162013
if (retval == NULL) {
20172014
X509_free(peer);
20182015
return NULL;

0 commit comments

Comments
 (0)