Skip to content

Commit 12edf1d

Browse files
tniessenrichardlau
authored andcommitted
src: avoid redundant call to std::get_if<>()
Signed-off-by: Tobias Nießen <[email protected]> PR-URL: #64094 Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Edy Silva <[email protected]>
1 parent 3bdd7e2 commit 12edf1d

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/crypto/crypto_dh.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,10 +449,9 @@ EVPKeyCtxPointer DhKeyGenTraits::Setup(DhKeyPairGenConfig* params) {
449449
if (!dh) return {};
450450

451451
key_params = EVPKeyPointer::NewDH(std::move(dh));
452-
} else if (std::get_if<int>(&params->params.prime)) {
452+
} else if (int* prime_size = std::get_if<int>(&params->params.prime)) {
453453
auto param_ctx = EVPKeyCtxPointer::NewFromID(EVP_PKEY_DH);
454454
#ifndef OPENSSL_IS_BORINGSSL
455-
int* prime_size = std::get_if<int>(&params->params.prime);
456455
if (!param_ctx.initForParamgen() ||
457456
!param_ctx.setDhParameters(*prime_size, params->params.generator)) {
458457
return {};

0 commit comments

Comments
 (0)