From ecdeaa4bc5300ab793eb7e46f192473ee8f22a16 Mon Sep 17 00:00:00 2001 From: Epixu Date: Mon, 3 Jun 2024 20:04:56 +0300 Subject: [PATCH] Avoid instantiating a string if we don't have to --- source/HTML.cpp | 2 +- source/Logger.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/HTML.cpp b/source/HTML.cpp index 979a8c7..6e19424 100644 --- a/source/HTML.cpp +++ b/source/HTML.cpp @@ -13,7 +13,7 @@ using namespace Langulus::Logger; /// Create an HTML file duplicator/redirector /// @param filename - the relative filename of the log file -ToHTML::ToHTML(const std::string& filename) : mFilename {filename} { +ToHTML::ToHTML(const TextView& filename) : mFilename {filename} { mFile.open(mFilename, std::ios::out | std::ios::trunc); if (not mFile) throw std::runtime_error {"Can't open log file"}; diff --git a/source/Logger.hpp b/source/Logger.hpp index 9fb4a10..af1769c 100644 --- a/source/Logger.hpp +++ b/source/Logger.hpp @@ -339,7 +339,7 @@ namespace Langulus::Logger void WriteHeader() const; public: - LANGULUS_API(LOGGER) ToHTML(const std::string&); + LANGULUS_API(LOGGER) ToHTML(const TextView&); LANGULUS_API(LOGGER) ~ToHTML(); LANGULUS_API(LOGGER) void Write(const TextView&) const noexcept;