Skip to content

Commit a811c34

Browse files
authored
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 652d033 commit a811c34

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
@@ -454,10 +454,9 @@ EVPKeyCtxPointer DhKeyGenTraits::Setup(DhKeyPairGenConfig* params) {
454454
if (!dh) return {};
455455

456456
key_params = EVPKeyPointer::NewDH(std::move(dh));
457-
} else if (std::get_if<int>(&params->params.prime)) {
457+
} else if (int* prime_size = std::get_if<int>(&params->params.prime)) {
458458
auto param_ctx = EVPKeyCtxPointer::NewFromID(EVP_PKEY_DH);
459459
#ifndef OPENSSL_IS_BORINGSSL
460-
int* prime_size = std::get_if<int>(&params->params.prime);
461460
if (!param_ctx.initForParamgen() ||
462461
!param_ctx.setDhParameters(*prime_size, params->params.generator)) {
463462
return {};

0 commit comments

Comments
 (0)