Skip to content

Commit aac234d

Browse files
committed
src: avoid redundant call to std::get_if<>()
Signed-off-by: Tobias Nießen <tniessen@tnie.de>
1 parent ccc2d7c commit aac234d

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)