From 2cd8168f274a9239a370ba368adb206cb07f7496 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Thu, 10 Oct 2019 21:57:05 +0000 Subject: [PATCH] Inline internal single-use fputs template --- include/fmt/color.h | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/include/fmt/color.h b/include/fmt/color.h index dbaafb2a..5f914104 100644 --- a/include/fmt/color.h +++ b/include/fmt/color.h @@ -444,22 +444,12 @@ FMT_CONSTEXPR ansi_color_escape make_emphasis(emphasis em) FMT_NOEXCEPT { return ansi_color_escape(em); } -template -inline void fputs(const Char* chars, FILE* stream) FMT_NOEXCEPT { - std::fputs(chars, stream); -} - -template <> -inline void fputs(const wchar_t* chars, FILE* stream) FMT_NOEXCEPT { - std::fputws(chars, stream); -} - template inline void reset_color(FILE* stream) FMT_NOEXCEPT { - fputs(internal::data::reset_color, stream); + std::fwrite(internal::data::reset_color, 1, sizeof(internal::data::reset_color), stream); } template <> inline void reset_color(FILE* stream) FMT_NOEXCEPT { - fputs(internal::data::wreset_color, stream); + std::fputws(internal::data::wreset_color, stream); } template