diff options
author | Daniel Bevenius <daniel.bevenius@gmail.com> | 2020-05-15 06:52:31 +0300 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2020-05-20 13:38:25 +0300 |
commit | 37b4717728413e174ae3d295c74a5b443ca0d901 (patch) | |
tree | bdc4992a4a92b8eecd67a68e141eb576eba6c0e0 /src/base_object-inl.h | |
parent | d2a6f06dce724d24b0aa3c7a2821e4757002bffc (diff) |
src: remove unnecessary else in base_object-inl.h
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 <himself65@outlook.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Diffstat (limited to 'src/base_object-inl.h')
-rw-r--r-- | src/base_object-inl.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/base_object-inl.h b/src/base_object-inl.h index 60ccf81cc55..f6e980e8749 100644 --- a/src/base_object-inl.h +++ b/src/base_object-inl.h @@ -217,20 +217,22 @@ BaseObject::PointerData* BaseObjectPtrImpl<T, kIsWeak>::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 <typename T, bool kIsWeak> BaseObject* BaseObjectPtrImpl<T, kIsWeak>::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 <typename T, bool kIsWeak> |