diff options
author | Daniel Bevenius <daniel.bevenius@gmail.com> | 2018-03-08 13:56:31 +0100 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2018-03-11 16:23:31 +0100 |
commit | e16a2be8d8ec70866d3eed7dddbe7f11b4f20aa7 (patch) | |
tree | dfde8772903c49dccad34fa48be05cb8fadd8e27 /src/env.h | |
parent | 695590e386845bc11bb42aa7f26327f2fba6d2a5 (diff) | |
download | node-new-e16a2be8d8ec70866d3eed7dddbe7f11b4f20aa7.tar.gz |
src: avoid duplicate Before/AtExitCallback structs
Currently, BeforeExitCallback and AtExitCallback are identical apart for
the name of the struct. This commit introduces an ExitCallback struct
with can be used in both cases to avoid the duplication.
PR-URL: https://github.com/nodejs/node/pull/19226
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/env.h')
-rw-r--r-- | src/env.h | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -823,17 +823,13 @@ class Environment { static const int kFsStatsFieldsLength = 2 * 14; AliasedBuffer<double, v8::Float64Array> fs_stats_field_array_; - struct BeforeExitCallback { + struct ExitCallback { void (*cb_)(void* arg); void* arg_; }; - std::list<BeforeExitCallback> before_exit_functions_; + std::list<ExitCallback> before_exit_functions_; - struct AtExitCallback { - void (*cb_)(void* arg); - void* arg_; - }; - std::list<AtExitCallback> at_exit_functions_; + std::list<ExitCallback> at_exit_functions_; struct PromiseHookCallback { promise_hook_func cb_; |