Codechange: make start-ai console command parsing work with std::string_view
This commit is contained in:
@@ -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 (;;) {
|
||||
|
||||
Reference in New Issue
Block a user