2
0
mirror of https://github.com/wolfpld/tracy synced 2026-01-19 04:52:09 +00:00

Use string_view as constexpr std::string requires recent compilers

This was not building with visual studio Version 17.14.13 (August 2025)
This commit is contained in:
Clément Grégoire
2026-01-13 10:57:18 +01:00
parent 76e0ab135b
commit 5b79a9a825

View File

@@ -753,7 +753,7 @@ void TracyLlm::UpdateModels()
}
}
static void Replace( std::string& str, const std::string& from, const std::string& to )
static void Replace( std::string& str, std::string_view from, std::string_view to )
{
std::string::size_type pos;
while( ( pos = str.find( from ) ) != std::string::npos )
@@ -774,8 +774,8 @@ void TracyLlm::ResetChat()
void TracyLlm::UpdateSystemPrompt()
{
static constexpr std::string UserToken = "%USER%";
static constexpr std::string TimeToken = "%TIME%";
static constexpr std::string_view UserToken = "%USER%";
static constexpr std::string_view TimeToken = "%TIME%";
auto userName = GetUserFullName();
if( !userName ) userName = GetUserLogin();