From: tb Date: Mon, 25 Dec 2023 21:27:03 +0000 (+0000) Subject: Simplify EVP_PKEY_up_ref() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=60c2bb4ddeacb3def452bd6bd7e2c2a4b95e53df;p=openbsd Simplify EVP_PKEY_up_ref() There is no need for a local variable and a ternary operator here. ok jsing --- diff --git a/lib/libcrypto/evp/p_lib.c b/lib/libcrypto/evp/p_lib.c index dce4dbd5a6a..2b409220bb7 100644 --- a/lib/libcrypto/evp/p_lib.c +++ b/lib/libcrypto/evp/p_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p_lib.c,v 1.40 2023/12/25 21:25:24 tb Exp $ */ +/* $OpenBSD: p_lib.c,v 1.41 2023/12/25 21:27:03 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -213,8 +213,7 @@ EVP_PKEY_new(void) int EVP_PKEY_up_ref(EVP_PKEY *pkey) { - int refs = CRYPTO_add(&pkey->references, 1, CRYPTO_LOCK_EVP_PKEY); - return ((refs > 1) ? 1 : 0); + return CRYPTO_add(&pkey->references, 1, CRYPTO_LOCK_EVP_PKEY) > 0; } /* Setup a public key ASN1 method from a NID or a string.