Codechange: make start-ai console command parsing work with std::string_view

This commit is contained in:
Rubidium
2025-04-25 00:05:16 +02:00
committed by rubidium42
parent ccbf7f4a46
commit 08ce16018b
3 changed files with 10 additions and 12 deletions

View File

@@ -20,10 +20,10 @@
#include "../safeguards.h"
void ScriptConfig::Change(std::optional<std::string> name, int version, bool force_exact_match)
void ScriptConfig::Change(std::optional<std::string_view> name, int version, bool force_exact_match)
{
if (name.has_value()) {
this->name = std::move(name.value());
this->name = name.value();
this->info = this->FindInfo(this->name, version, force_exact_match);
} else {
this->info = nullptr;
@@ -140,7 +140,7 @@ int ScriptConfig::GetVersion() const
return this->version;
}
void ScriptConfig::StringToSettings(const std::string &value)
void ScriptConfig::StringToSettings(std::string_view value)
{
std::string_view to_process = value;
for (;;) {