diff --git a/include/spdlog/pattern_formatter-inl.h b/include/spdlog/pattern_formatter-inl.h index ca835b014..ce7e21052 100644 --- a/include/spdlog/pattern_formatter-inl.h +++ b/include/spdlog/pattern_formatter-inl.h @@ -877,7 +877,7 @@ class mdc_formatter : public flag_formatter { : flag_formatter(padinfo) {} void format(const details::log_msg &, const std::tm &, memory_buf_t &dest) override { - auto mdc_map = mdc::get_context(); + auto &mdc_map = mdc::get_context(); if (mdc_map.empty()) { ScopedPadder p(0, padinfo_, dest); return;