Skip to content

Commit

Permalink
removed duplicate code.
Browse files Browse the repository at this point in the history
  • Loading branch information
mwinterb committed May 18, 2018
1 parent 92ebd63 commit 7957aa1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions include/fmt/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -987,11 +987,14 @@ class format_arg_store {

friend class basic_format_args<Context>;

static FMT_CONSTEXPR uint64_t get_types() {
return IS_PACKED ? internal::get_types<Context, Args...>()
: -static_cast<int64_t>(NUM_ARGS);
}

public:
#if FMT_USE_CONSTEXPR
static constexpr uint64_t TYPES =
IS_PACKED ? internal::get_types<Context, Args...>()
: -static_cast<int64_t>(NUM_ARGS);
static constexpr uint64_t TYPES = get_types();
#else
static const uint64_t TYPES;
#endif
Expand All @@ -1009,9 +1012,7 @@ class format_arg_store {

#if !FMT_USE_CONSTEXPR
template <typename Context, typename ...Args>
const uint64_t format_arg_store<Context, Args...>::TYPES = IS_PACKED ?
internal::get_types<Context, Args...>() :
-static_cast<int64_t>(NUM_ARGS);
const uint64_t format_arg_store<Context, Args...>::TYPES = get_types();
#endif

/**
Expand Down

0 comments on commit 7957aa1

Please sign in to comment.