Skip to content

Commit 35d9990

Browse files
davestersjasnell
authored andcommitted
src: move default assignment of async_id_ in async_wrap.h
Moving the default assignment of async_id from the constructor in async_wrap.cc to class definition in async_wrap.h PR-URL: #23495 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent d70a0cd commit 35d9990

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/async_wrap.cc

-1
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,6 @@ AsyncWrap::AsyncWrap(Environment* env,
563563
CHECK_NE(provider, PROVIDER_NONE);
564564
CHECK_GE(object->InternalFieldCount(), 1);
565565

566-
async_id_ = -1;
567566
// Use AsyncReset() call to execute the init() callbacks.
568567
AsyncReset(execution_async_id, silent);
569568
}

src/async_wrap.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ class AsyncWrap : public BaseObject {
200200
inline AsyncWrap();
201201
const ProviderType provider_type_;
202202
// Because the values may be Reset(), cannot be made const.
203-
double async_id_;
203+
double async_id_ = -1;
204204
double trigger_async_id_;
205205
};
206206

0 commit comments

Comments
 (0)