From 11779077a026d6291efa467e138dab23332f80cd Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 2 Jun 2021 21:18:59 +0200 Subject: [PATCH] Use ternary operator with the most common case first Signed-off-by: Gilles Peskine --- library/bignum.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/library/bignum.c b/library/bignum.c index 52783f53e..f0debe849 100644 --- a/library/bignum.c +++ b/library/bignum.c @@ -2488,10 +2488,7 @@ int mbedtls_mpi_random( mbedtls_mpi *X, * is small, use a higher repeat count, otherwise the probability of * failure is macroscopic. */ - if( n_bytes <= 4 ) - count = 250; - else - count = 30; + count = ( n_bytes > 4 ? 30 : 250 ); /* Ensure that target MPI has exactly the same number of limbs * as the upper bound, even if the upper bound has leading zeros.