3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-07 01:54:10 +00:00

kernel: pass-by-value into Design::scratchpad_set_string() too

This commit is contained in:
Eddie Hung 2020-03-27 12:21:09 -07:00
parent 6ca7844cec
commit 348e892314
2 changed files with 3 additions and 3 deletions

View file

@ -489,9 +489,9 @@ void RTLIL::Design::scratchpad_set_bool(const std::string &varname, bool value)
scratchpad[varname] = value ? "true" : "false"; scratchpad[varname] = value ? "true" : "false";
} }
void RTLIL::Design::scratchpad_set_string(const std::string &varname, const std::string &value) void RTLIL::Design::scratchpad_set_string(const std::string &varname, std::string value)
{ {
scratchpad[varname] = value; scratchpad[varname] = std::move(value);
} }
int RTLIL::Design::scratchpad_get_int(const std::string &varname, int default_value) const int RTLIL::Design::scratchpad_get_int(const std::string &varname, int default_value) const

View file

@ -999,7 +999,7 @@ struct RTLIL::Design
void scratchpad_set_int(const std::string &varname, int value); void scratchpad_set_int(const std::string &varname, int value);
void scratchpad_set_bool(const std::string &varname, bool value); void scratchpad_set_bool(const std::string &varname, bool value);
void scratchpad_set_string(const std::string &varname, const std::string &value); void scratchpad_set_string(const std::string &varname, std::string value);
int scratchpad_get_int(const std::string &varname, int default_value = 0) const; int scratchpad_get_int(const std::string &varname, int default_value = 0) const;
bool scratchpad_get_bool(const std::string &varname, bool default_value = false) const; bool scratchpad_get_bool(const std::string &varname, bool default_value = false) const;