3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-10-10 09:48:06 +00:00

Make the Const string constructor take the string by value and move it into the const

This commit is contained in:
Robert O'Callahan 2025-09-12 04:57:08 +00:00
parent 7719beb4ae
commit 6b43fca8df
2 changed files with 3 additions and 3 deletions

View file

@ -264,10 +264,10 @@ std::string& Const::get_str() {
return *get_if_str();
}
RTLIL::Const::Const(const std::string &str)
RTLIL::Const::Const(std::string str)
{
flags = RTLIL::CONST_FLAG_STRING;
new ((void*)&str_) std::string(str);
new ((void*)&str_) std::string(std::move(str));
tag = backing_tag::string;
}