src: set ModuleWrap internal fields only once · nodejs/node@2c2892b · GitHub
Skip to content

Commit 2c2892b

Browse files
joyeecheungrichardlau
authored andcommitted
src: set ModuleWrap internal fields only once
There is no need to initialize the internal fields to undefined and then initialize them to something else in the caller. Simply pass the internal fields into the constructor to initialize them just once. PR-URL: #49391 Backport-PR-URL: #51004 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent 425e011 commit 2c2892b

2 files changed

Lines changed: 26 additions & 18 deletions

File tree

src/module_wrap.cc

Lines changed: 23 additions & 17 deletions

src/module_wrap.h

Lines changed: 3 additions & 1 deletion

0 commit comments

Comments
 (0)