From a942f7280ae058bb5361184ec05c85da6a4759ee Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Fri, 15 May 2020 05:52:31 +0200 Subject: [PATCH] src: remove unnecessary else in base_object-inl.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit removes two unnecessary else statements in base_object-inl.h. It also tries to make the if statements consistent with regards to braces. PR-URL: https://github.com/nodejs/node/pull/33413 Reviewed-By: Zeyu Yang Reviewed-By: Richard Lau Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Juan José Arboleda --- src/base_object-inl.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/base_object-inl.h b/src/base_object-inl.h index 60ccf81cc559c5..f6e980e8749f61 100644 --- a/src/base_object-inl.h +++ b/src/base_object-inl.h @@ -217,20 +217,22 @@ BaseObject::PointerData* BaseObjectPtrImpl::pointer_data() const { if (kIsWeak) { return data_.pointer_data; - } else { - if (get_base_object() == nullptr) return nullptr; - return get_base_object()->pointer_data(); } + if (get_base_object() == nullptr) { + return nullptr; + } + return get_base_object()->pointer_data(); } template BaseObject* BaseObjectPtrImpl::get_base_object() const { if (kIsWeak) { - if (pointer_data() == nullptr) return nullptr; + if (pointer_data() == nullptr) { + return nullptr; + } return pointer_data()->self; - } else { - return data_.target; } + return data_.target; } template