diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index 8daf2c821..adcc5f41c 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -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; } diff --git a/kernel/rtlil.h b/kernel/rtlil.h index 5271a3111..74a57e554 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -859,7 +859,7 @@ private: public: Const() : flags(RTLIL::CONST_FLAG_NONE), tag(backing_tag::bits), bits_(std::vector()) {} - Const(const std::string &str); + Const(std::string str); Const(long long val); // default width is 32 Const(long long val, int width); Const(RTLIL::State bit, int width = 1);