diff options
author | Eddie Hung <eddie@fpgeh.com> | 2020-03-27 12:21:09 -0700 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2020-03-27 12:21:09 -0700 |
commit | 348e8923148f1cc1bfb87bb71b7566d4bc111704 (patch) | |
tree | d0521642a3fd3e566d12acda552c32644eba83c4 | |
parent | 6ca7844ceca934064e8914c9dd0853eaaa495bad (diff) | |
download | yosys-348e8923148f1cc1bfb87bb71b7566d4bc111704.tar.gz yosys-348e8923148f1cc1bfb87bb71b7566d4bc111704.tar.bz2 yosys-348e8923148f1cc1bfb87bb71b7566d4bc111704.zip |
kernel: pass-by-value into Design::scratchpad_set_string() too
-rw-r--r-- | kernel/rtlil.cc | 4 | ||||
-rw-r--r-- | kernel/rtlil.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index baa033401..ebaaa5492 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -489,9 +489,9 @@ void RTLIL::Design::scratchpad_set_bool(const std::string &varname, bool value) 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 diff --git a/kernel/rtlil.h b/kernel/rtlil.h index c0f1c7fa8..7ca449f46 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -999,7 +999,7 @@ struct RTLIL::Design void scratchpad_set_int(const std::string &varname, int 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; bool scratchpad_get_bool(const std::string &varname, bool default_value = false) const; |