perf: std::move string

Co-authored-by: MistEO <mistereo@hotmail.com>
This commit is contained in:
zzyyyl
2022-10-11 19:23:15 +08:00
parent 0a8db14315
commit 809453e40a
9 changed files with 9 additions and 9 deletions

View File

@@ -18,7 +18,7 @@ bool asst::RoguelikeCustomStartTaskPlugin::verify(AsstMsg msg, const json::value
if (!roguelike_name_opt) {
return false;
}
const auto& roguelike_name = roguelike_name_opt.value() + "@";
const std::string roguelike_name = std::move(roguelike_name_opt.value()) + "@";
const std::string& task = details.get("details", "task", "");
std::string_view task_view = task;
if (task_view.starts_with(roguelike_name)) {