Skip to content

async_hooks: reduce code duplication by using a factory

Rodrigo Muino Tomonari requested to merge github/fork/BridgeAR/dry-code into master

The difference between the hooks is only a single variable and it can be initialized in the beginning. So I think it's nicer to stick to DRY. The init function is also very similar but that would require an additional check, so I kept it as it is.

I also added a TODO entry as the comment somewhat confused me (ping @trevnorris ).

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

async_hooks

Merge request reports

Loading