diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-10-26 18:29:46 +0200 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-11-07 10:39:40 +0100 |
commit | 6072e01c938e22498cd46c3d8a2c21a16a632456 (patch) | |
tree | 4d0925f227eba3f382b246ea2ff878b64eb47952 /src/node_zlib.cc | |
parent | 35ae49db515ec4a7ad74ee3666eda34e7bfd85b5 (diff) | |
download | android-node-v8-6072e01c938e22498cd46c3d8a2c21a16a632456.tar.gz android-node-v8-6072e01c938e22498cd46c3d8a2c21a16a632456.tar.bz2 android-node-v8-6072e01c938e22498cd46c3d8a2c21a16a632456.zip |
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_zlib.cc')
-rw-r--r-- | src/node_zlib.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node_zlib.cc b/src/node_zlib.cc index 30fef0ff1d..fdcf685caf 100644 --- a/src/node_zlib.cc +++ b/src/node_zlib.cc @@ -386,7 +386,7 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork { // v8 land! void AfterThreadPoolWork(int status) override { AllocScope alloc_scope(this); - OnScopeLeave on_scope_leave([&]() { Unref(); }); + auto on_scope_leave = OnScopeLeave([&]() { Unref(); }); write_in_progress_ = false; |