Use more fmt::split_sv
This commit is contained in:
@@ -29,7 +29,7 @@ void fmt_class_string<cheat_type>::format(std::string& out, u64 arg)
|
||||
|
||||
bool cheat_info::from_str(std::string_view cheat_line)
|
||||
{
|
||||
const auto cheat_vec = fmt::split(cheat_line, {"@@@"}, false);
|
||||
auto cheat_vec = fmt::split(cheat_line, {"@@@"}, false);
|
||||
|
||||
s64 val64 = 0;
|
||||
if (cheat_vec.size() != 5 || !try_to_int64(&val64, cheat_vec[2], 0, cheat_type_max - 1))
|
||||
@@ -38,11 +38,11 @@ bool cheat_info::from_str(std::string_view cheat_line)
|
||||
return false;
|
||||
}
|
||||
|
||||
game = cheat_vec[0];
|
||||
description = cheat_vec[1];
|
||||
game = std::move(cheat_vec[0]);
|
||||
description = std::move(cheat_vec[1]);
|
||||
type = cheat_type{::narrow<u8>(val64)};
|
||||
offset = std::stoul(cheat_vec[3]);
|
||||
red_script = cheat_vec[4];
|
||||
red_script = std::move(cheat_vec[4]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user