From 7c42e8547c5255e2d8ab14a6e0afd0f0e120672f Mon Sep 17 00:00:00 2001 From: Alexey Ochapov Date: Mon, 25 Jan 2021 16:35:24 +0300 Subject: [PATCH] remove unnecessary `compiled_parts` static --- include/fmt/compile.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/include/fmt/compile.h b/include/fmt/compile.h index 90692c99..39e34f1c 100644 --- a/include/fmt/compile.h +++ b/include/fmt/compile.h @@ -649,14 +649,11 @@ template constexpr auto get_parts_array() { return result; } -template -constexpr static auto compiled_parts = get_parts_array(); - template constexpr auto make_compiled_part() { using char_type = typename CompiledString::char_type; - constexpr format_part part = compiled_parts[part_index]; + constexpr auto part = get_parts_array()[part_index]; if constexpr (part.part_kind == decltype(part)::kind::arg_index_auto || part.part_kind == decltype(part)::kind::arg_index_manual) { using id_type = get_type; @@ -695,7 +692,7 @@ constexpr auto make_compiled_part() { // Prepares a compiled representation for non-empty format string template constexpr auto make_compiled_parts() { - if constexpr (part_index == compiled_parts.size() - 1) { + if constexpr (part_index == get_parts_array().size() - 1) { return make_compiled_part(); } else { return make_concat(