From ff05bc2688c573ae66b29734c9d4f22beef63345 Mon Sep 17 00:00:00 2001 From: Richard Thier Date: Mon, 20 Dec 2021 13:29:47 +0100 Subject: [PATCH] added if constexpr(..) where it could be --- magyarsort.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/magyarsort.h b/magyarsort.h index 0967990..c2d538e 100644 --- a/magyarsort.h +++ b/magyarsort.h @@ -317,11 +317,11 @@ namespace MagyarSort { #endif // !NO_MLOCK // "Garbage-collection" - if(GC) { + if constexpr (GC) { arc = std::vector(); // This must be implemented, because we can only access // the static in our function body so this is the "way". - if(GC_WITHOUT_SORT) { + if constexpr (GC_WITHOUT_SORT) { return; } } @@ -358,7 +358,7 @@ namespace MagyarSort { // But instead of the below, we do a trickery... // // Rem.: The branch is optimized out in compile time! - if(REUSE) { + if constexpr (REUSE) { arc.resize(size); } else { // Must not be .clean() !!! @@ -399,7 +399,7 @@ namespace MagyarSort { */ template inline void gc() noexcept { - if(FORCE) { + if constexpr (FORCE) { // Only GC-ing MagyarSort::sort_impl(nullptr, 0); } else {