Skip to content

Commit 6a035d9

Browse files
remove unnecessary std::move when constructing RapidYamlError
From a compile warning: jsonnet/core/vm.cpp:3484:30: warning: moving a temporary object prevents copy elision [-Wpessimizing-move] 3484 | throw RapidYamlError(std::move(msg.str())); | ^ jsonnet/core/vm.cpp:3484:30: note: remove std::move call here 3484 | throw RapidYamlError(std::move(msg.str()));
1 parent 654796e commit 6a035d9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

core/vm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3484,7 +3484,7 @@ class Interpreter {
34843484
msg << loc.offset << ":";
34853485
}
34863486
msg << " " << std::string_view(inner_msg, length);
3487-
throw RapidYamlError(std::move(msg.str()));
3487+
throw RapidYamlError(msg.str());
34883488
}
34893489
};
34903490

0 commit comments

Comments
 (0)