From 8ce99faa5073298fcec9be91a30e3aa98a8620d3 Mon Sep 17 00:00:00 2001 From: David Corona Date: Fri, 12 Oct 2018 09:55:13 -0700 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/23495 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil Reviewed-By: James M Snell Reviewed-By: Shelley Vohr Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Trivikram Kamat --- src/async_wrap.cc | 1 - src/async_wrap.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/async_wrap.cc b/src/async_wrap.cc index 596fcc8356d..29bd64f2c5e 100644 --- a/src/async_wrap.cc +++ b/src/async_wrap.cc @@ -563,7 +563,6 @@ AsyncWrap::AsyncWrap(Environment* env, CHECK_NE(provider, PROVIDER_NONE); CHECK_GE(object->InternalFieldCount(), 1); - async_id_ = -1; // Use AsyncReset() call to execute the init() callbacks. AsyncReset(execution_async_id, silent); } diff --git a/src/async_wrap.h b/src/async_wrap.h index 360380afc34..e3d5748bbc6 100644 --- a/src/async_wrap.h +++ b/src/async_wrap.h @@ -200,7 +200,7 @@ class AsyncWrap : public BaseObject { inline AsyncWrap(); const ProviderType provider_type_; // Because the values may be Reset(), cannot be made const. - double async_id_; + double async_id_ = -1; double trigger_async_id_; };