From f91c8aaaffa17b5b5f5799a50c9c6a13878acba8 Mon Sep 17 00:00:00 2001 From: tb <> Date: Mon, 25 Dec 2023 21:27:03 +0000 Subject: Simplify EVP_PKEY_up_ref() There is no need for a local variable and a ternary operator here. ok jsing --- src/lib/libcrypto/evp/p_lib.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/evp/p_lib.c b/src/lib/libcrypto/evp/p_lib.c index dce4dbd5a6..2b409220bb 100644 --- a/src/lib/libcrypto/evp/p_lib.c +++ b/src/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. -- cgit v1.2.3-55-g6feb