From: Eddie Hung Date: Fri, 27 Mar 2020 19:21:09 +0000 (-0700) Subject: kernel: pass-by-value into Design::scratchpad_set_string() too X-Git-Tag: working-ls180~702^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=348e8923148f1cc1bfb87bb71b7566d4bc111704;p=yosys.git kernel: pass-by-value into Design::scratchpad_set_string() too --- 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;