From 34e2ca7d2d0a0fb4722dfa5e884d5657ea45d8f8 Mon Sep 17 00:00:00 2001 From: tb <> Date: Wed, 27 Mar 2024 01:22:30 +0000 Subject: Unify *_up_ref() implementations No need for an inconsistently named local variable and a ternary operator. ok jsing --- src/lib/libcrypto/ec/ec_key.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/lib/libcrypto/ec') diff --git a/src/lib/libcrypto/ec/ec_key.c b/src/lib/libcrypto/ec/ec_key.c index dd976898ad..e959829478 100644 --- a/src/lib/libcrypto/ec/ec_key.c +++ b/src/lib/libcrypto/ec/ec_key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_key.c,v 1.39 2023/11/29 21:35:57 tb Exp $ */ +/* $OpenBSD: ec_key.c,v 1.40 2024/03/27 01:22:30 tb Exp $ */ /* * Written by Nils Larsch for the OpenSSL project. */ @@ -204,8 +204,7 @@ LCRYPTO_ALIAS(EC_KEY_dup); int EC_KEY_up_ref(EC_KEY *r) { - int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_EC); - return ((i > 1) ? 1 : 0); + return CRYPTO_add(&r->references, 1, CRYPTO_LOCK_EC) > 1; } LCRYPTO_ALIAS(EC_KEY_up_ref); -- cgit v1.2.3-55-g6feb