diff --git a/Utilities/cheat_info.cpp b/Utilities/cheat_info.cpp index 7745d26732..e67e103214 100644 --- a/Utilities/cheat_info.cpp +++ b/Utilities/cheat_info.cpp @@ -29,7 +29,7 @@ void fmt_class_string::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(val64)}; offset = std::stoul(cheat_vec[3]); - red_script = cheat_vec[4]; + red_script = std::move(cheat_vec[4]); return true; } diff --git a/rpcs3/Emu/Io/camera_config.cpp b/rpcs3/Emu/Io/camera_config.cpp index e9ef5de7c5..f1fabe5531 100644 --- a/rpcs3/Emu/Io/camera_config.cpp +++ b/rpcs3/Emu/Io/camera_config.cpp @@ -77,7 +77,7 @@ void cfg_camera::camera_setting::from_string(std::string_view text) return; } - const std::vector list = fmt::split(text, { "," }); + const std::vector list = fmt::split_sv(text, { "," }); if (list.size() != member_count) { diff --git a/rpcs3/util/cpu_stats.cpp b/rpcs3/util/cpu_stats.cpp index 8203d1977b..0f4149e909 100644 --- a/rpcs3/util/cpu_stats.cpp +++ b/rpcs3/util/cpu_stats.cpp @@ -208,22 +208,23 @@ namespace utils content << proc_stat.rdbuf(); proc_stat.close(); - const std::vector lines = fmt::split(content.str(), {"\n"}); + const std::string content_str = content.str(); + const std::vector lines = fmt::split_sv(content_str, {"\n"}); if (lines.empty()) { perf_log.error("/proc/stat is empty"); return; } - for (const std::string& line : lines) + for (const std::string_view& line : lines) { - const std::vector tokens = fmt::split(line, {" "}); + const std::vector tokens = fmt::split_sv(line, {" "}); if (tokens.size() < 5) { return; } - const std::string& token = tokens[0]; + const std::string_view token = tokens[0]; if (!token.starts_with("cpu")) { return; diff --git a/rpcs3/util/sysinfo.cpp b/rpcs3/util/sysinfo.cpp index fb6dd6d7f7..66e551f42a 100755 --- a/rpcs3/util/sysinfo.cpp +++ b/rpcs3/util/sysinfo.cpp @@ -765,7 +765,8 @@ utils::OS_version utils::get_OS_version() #else if (struct utsname details = {}; !uname(&details)) { - const std::vector version_list = fmt::split(details.release, { "." }); + const std::string_view release = details.release; + const std::vector version_list = fmt::split_sv(release, { "." }); const auto get_version_part = [&version_list](usz i) -> usz { if (version_list.size() <= i) return 0;