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

Appearance settings

Commit fa0e8d7

Browse filesBrowse files
tniessenmarco-ippolito
authored andcommitted
crypto: avoid std::function
Using a template type lets the compiler choose an appropriate type that likely is more efficient than std::function since the lambda expressions at the call sites do not capture any values from surrounding scopes. PR-URL: #53683 Reviewed-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 parent ef5dabd commit fa0e8d7
Copy full SHA for fa0e8d7

1 file changed

+5-6Lines changed: 5 additions & 6 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/crypto/crypto_keys.cc‎

Copy file name to clipboardExpand all lines: src/crypto/crypto_keys.cc
+5-6Lines 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-
ParseKeyResult TryParsePublicKey(
79-
EVPKeyPointer* pkey,
80-
const BIOPointer& bp,
81-
const char* name,
82-
// NOLINTNEXTLINE(runtime/int)
83-
const std::function<EVP_PKEY*(const unsigned char** p, long l)>& parse) {
78+
template <typename F>
79+
ParseKeyResult TryParsePublicKey(EVPKeyPointer* pkey,
80+
const BIOPointer& bp,
81+
const char* name,
82+
F&& parse) {
8483
unsigned char* der_data;
8584
long der_len; // NOLINT(runtime/int)
8685

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.