Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-10-26 19:29:46 +0300
committerAnna Henningsen <anna@addaleax.net>2019-11-07 12:39:40 +0300
commit6072e01c938e22498cd46c3d8a2c21a16a632456 (patch)
tree4d0925f227eba3f382b246ea2ff878b64eb47952 /src/node_binding.cc
parent35ae49db515ec4a7ad74ee3666eda34e7bfd85b5 (diff)
src: do not use `std::function` for `OnScopeLeave`
Using `std::function` adds an extra layer of indirection, and in particular, heap allocations that are not necessary in our use case here. PR-URL: https://github.com/nodejs/node/pull/30134 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_binding.cc')
-rw-r--r--src/node_binding.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node_binding.cc b/src/node_binding.cc
index f0a148a4956..3ae361634d1 100644
--- a/src/node_binding.cc
+++ b/src/node_binding.cc
@@ -152,7 +152,7 @@ void* wrapped_dlopen(const char* filename, int flags) {
Mutex::ScopedLock lock(dlhandles_mutex);
uv_fs_t req;
- OnScopeLeave cleanup([&]() { uv_fs_req_cleanup(&req); });
+ auto cleanup = OnScopeLeave([&]() { uv_fs_req_cleanup(&req); });
int rc = uv_fs_stat(nullptr, &req, filename, nullptr);
if (rc != 0) {