Skip to content

Commit a811c34

Browse files
authored
src: avoid redundant call to std::get_if<>()
Signed-off-by: Tobias Nießen <tniessen@tnie.de> PR-URL: #64094 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
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)