From 012b0de29906af6402a05a95eed0253a662df78b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 16 Sep 2022 19:27:28 -0400 Subject: Avoid "else" after "return" --- .clang-tidy | 1 - include/chilbert/detail/MultiBitVec.hpp | 14 ++++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index d97cfa6..e096e94 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,7 +1,6 @@ Checks: > *, -*-avoid-c-arrays, - -*-else-after-return, -*-magic-numbers, -*-member-init, -*-move-const-arg, diff --git a/include/chilbert/detail/MultiBitVec.hpp b/include/chilbert/detail/MultiBitVec.hpp index ca48a94..269fb85 100644 --- a/include/chilbert/detail/MultiBitVec.hpp +++ b/include/chilbert/detail/MultiBitVec.hpp @@ -218,10 +218,12 @@ public: assert(size() == vec.size()); for (size_t ri = 0; ri < num_racks(); ++ri) { - size_t i = num_racks() - ri - 1; + const size_t i = num_racks() - ri - 1; if (rack(i) < vec.rack(i)) { return true; - } else if (rack(i) > vec.rack(i)) { + } + + if (rack(i) > vec.rack(i)) { return false; } } @@ -259,7 +261,9 @@ public: { if (bits == 0) { return *self(); - } else if (bits >= size()) { + } + + if (bits >= size()) { reset(); return *self(); } @@ -294,7 +298,9 @@ public: { if (bits == 0) { return *self(); - } else if (bits >= size()) { + } + + if (bits >= size()) { reset(); return *self(); } -- cgit v1.2.1