From 348e8923148f1cc1bfb87bb71b7566d4bc111704 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Fri, 27 Mar 2020 12:21:09 -0700 Subject: [PATCH] kernel: pass-by-value into Design::scratchpad_set_string() too --- kernel/rtlil.cc | 4 ++-- 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; -- 2.30.2