From d63e16568602c2845543acd93bc322272a7ab788 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/bio/bio_lib.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/lib/libcrypto/bio/bio_lib.c') diff --git a/src/lib/libcrypto/bio/bio_lib.c b/src/lib/libcrypto/bio/bio_lib.c index 2f490a42f9..ba71539223 100644 --- a/src/lib/libcrypto/bio/bio_lib.c +++ b/src/lib/libcrypto/bio/bio_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bio_lib.c,v 1.52 2024/03/02 09:22:41 tb Exp $ */ +/* $OpenBSD: bio_lib.c,v 1.53 2024/03/27 01:22:30 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -198,8 +198,7 @@ LCRYPTO_ALIAS(BIO_vfree); int BIO_up_ref(BIO *bio) { - int refs = CRYPTO_add(&bio->references, 1, CRYPTO_LOCK_BIO); - return (refs > 1) ? 1 : 0; + return CRYPTO_add(&bio->references, 1, CRYPTO_LOCK_BIO) > 1; } LCRYPTO_ALIAS(BIO_up_ref); -- cgit v1.2.3-55-g6feb