Core/Log: Pass string_view by value instead of ref
This commit is contained in:
@@ -39,7 +39,7 @@ namespace Nz
|
||||
* \param file Filename
|
||||
* \param function Name of the function throwing the error
|
||||
*/
|
||||
void AbstractLogger::WriteError(ErrorType type, const std::string_view& error, unsigned int line, const char* file, const char* function)
|
||||
void AbstractLogger::WriteError(ErrorType type, std::string_view error, unsigned int line, const char* file, const char* function)
|
||||
{
|
||||
NAZARA_USE_ANONYMOUS_NAMESPACE
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace Nz
|
||||
* \see WriteError
|
||||
*/
|
||||
|
||||
void FileLogger::Write(const std::string_view& string)
|
||||
void FileLogger::Write(std::string_view string)
|
||||
{
|
||||
if (m_forceStdOutput || m_stdReplicationEnabled)
|
||||
{
|
||||
@@ -147,7 +147,7 @@ namespace Nz
|
||||
* \see Write
|
||||
*/
|
||||
|
||||
void FileLogger::WriteError(ErrorType type, const std::string_view& error, unsigned int line, const char* file, const char* function)
|
||||
void FileLogger::WriteError(ErrorType type, std::string_view error, unsigned int line, const char* file, const char* function)
|
||||
{
|
||||
AbstractLogger::WriteError(type, error, line, file, function);
|
||||
m_outputFile.flush();
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace Nz
|
||||
* \see WriteError
|
||||
*/
|
||||
|
||||
void Log::Write(const std::string_view& string)
|
||||
void Log::Write(std::string_view string)
|
||||
{
|
||||
if (s_enabled)
|
||||
s_logger->Write(string);
|
||||
@@ -98,7 +98,7 @@ namespace Nz
|
||||
* \see Write
|
||||
*/
|
||||
|
||||
void Log::WriteError(ErrorType type, const std::string_view& error, unsigned int line, const char* file, const char* function)
|
||||
void Log::WriteError(ErrorType type, std::string_view error, unsigned int line, const char* file, const char* function)
|
||||
{
|
||||
if (s_enabled)
|
||||
s_logger->WriteError(type, error, line, file, function);
|
||||
|
||||
@@ -61,9 +61,9 @@ namespace Nz
|
||||
* \see WriteError
|
||||
*/
|
||||
|
||||
void StdLogger::Write(const std::string_view& error)
|
||||
void StdLogger::Write(std::string_view string)
|
||||
{
|
||||
fwrite(error.data(), sizeof(char), error.size(), stdout);
|
||||
fwrite(string.data(), sizeof(char), string.size(), stdout);
|
||||
fputc('\n', stdout);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace Nz
|
||||
* \see Write
|
||||
*/
|
||||
|
||||
void StdLogger::WriteError(ErrorType type, const std::string_view& error, unsigned int line, const char* file, const char* function)
|
||||
void StdLogger::WriteError(ErrorType type, std::string_view error, unsigned int line, const char* file, const char* function)
|
||||
{
|
||||
NAZARA_USE_ANONYMOUS_NAMESPACE
|
||||
|
||||
|
||||
@@ -257,7 +257,7 @@ namespace Nz
|
||||
* \param string String to write
|
||||
*/
|
||||
|
||||
bool Stream::Write(const std::string_view& string)
|
||||
bool Stream::Write(std::string_view string)
|
||||
{
|
||||
if (m_streamOptions & StreamOption::Text)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user