From 4b7c05903b99718accbb4eaa93b25a0686307479 Mon Sep 17 00:00:00 2001 From: gabime Date: Sat, 15 Feb 2020 12:11:01 +0200 Subject: [PATCH] optimize wincolor_sink to use array instead of map to find color codes --- include/spdlog/sinks/wincolor_sink.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/spdlog/sinks/wincolor_sink.h b/include/spdlog/sinks/wincolor_sink.h index 743db5c6..a051a1df 100644 --- a/include/spdlog/sinks/wincolor_sink.h +++ b/include/spdlog/sinks/wincolor_sink.h @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include namespace spdlog { @@ -52,7 +52,7 @@ protected: bool in_console_; bool should_do_colors_; std::unique_ptr formatter_; - std::unordered_map colors_; + std::array colors_; // set foreground color and return the orig console attributes (for resetting later) WORD set_foreground_color_(WORD attribs);