src: avoid redundant call to std::get_if<>()

Signed-off-by: Tobias Nießen <tniessen@tnie.de>
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Tobias Nießen authored and Antoine du Hamel committed 2026-07-30 13:51:42 +02:00
1 parent a653e9bb57
commit ce6f29e45b
1 file changed
+1 -2
+1 -2
View File
@@ -449,10 +449,9 @@ EVPKeyCtxPointer DhKeyGenTraits::Setup(DhKeyPairGenConfig* params) {
if (!dh) return {};
key_params = EVPKeyPointer::NewDH(std::move(dh));
} else if (std::get_if<int>(&params->params.prime)) {
} else if (int* prime_size = std::get_if<int>(&params->params.prime)) {
auto param_ctx = EVPKeyCtxPointer::NewFromID(EVP_PKEY_DH);
#ifndef OPENSSL_IS_BORINGSSL
int* prime_size = std::get_if<int>(&params->params.prime);
if (!param_ctx.initForParamgen() ||
!param_ctx.setDhParameters(*prime_size, params->params.generator)) {
return {};