Skip to content

Commit 2670f47

Browse files
committed
Fix warning
1 parent 09a674b commit 2670f47

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

include/spdlog/pattern_formatter-inl.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -525,16 +525,15 @@ class z_formatter final : public flag_formatter {
525525
void format(const details::log_msg &msg, const std::tm &tm_time, memory_buf_t &dest) override {
526526
const size_t field_size = 6;
527527
ScopedPadder p(field_size, padinfo_, dest);
528-
529-
if (time_type_ == pattern_time_type::utc) {
530-
dest.append("+00:00", "+00:00" + 6);
531-
return;
532-
}
533-
534528
#ifdef SPDLOG_NO_TZ_OFFSET
535529
const char *str = "+??:??";
536530
dest.append(str, str + 6);
537531
#else
532+
if (time_type_ == pattern_time_type::utc) {
533+
const char *zeroes = "+00:00";
534+
dest.append(zeroes, zeroes + 6);
535+
return;
536+
}
538537
auto total_minutes = get_cached_offset(msg, tm_time);
539538
bool is_negative = total_minutes < 0;
540539
if (is_negative) {

0 commit comments

Comments
 (0)