Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfa0e8d7

Browse files
tniessenmarco-ippolito
authored andcommitted
crypto: avoid std::function
Using a template type lets the compiler choose an appropriate typethat likely is more efficient than std::function since the lambdaexpressions at the call sites do not capture any values from surroundingscopes.PR-URL:#53683Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>Reviewed-By: Filip Skokan <panva.ip@gmail.com>Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>Reviewed-By: James M Snell <jasnell@gmail.com>Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
1 parentef5dabd commitfa0e8d7

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

‎src/crypto/crypto_keys.cc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,11 @@ void GetKeyFormatAndTypeFromJs(
7575
*offset +=2;
7676
}
7777

78-
ParseKeyResultTryParsePublicKey(
79-
EVPKeyPointer* pkey,
80-
const BIOPointer& bp,
81-
constchar* name,
82-
// NOLINTNEXTLINE(runtime/int)
83-
const std::function<EVP_PKEY*(constunsignedchar** p,long l)>& parse) {
78+
template<typename F>
79+
ParseKeyResultTryParsePublicKey(EVPKeyPointer* pkey,
80+
const BIOPointer& bp,
81+
constchar* name,
82+
F&& parse) {
8483
unsignedchar* der_data;
8584
long der_len;// NOLINT(runtime/int)
8685

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp