fix(module_formatter): Remove double moves

This commit is contained in:
patrick96 2020-12-03 11:54:11 +01:00 committed by Patrick Ziegler
parent bc87eb3b69
commit df485f0a60

View File

@ -140,12 +140,14 @@ namespace modules {
}
void module_formatter::add(string name, string fallback, vector<string>&& tags, vector<string>&& whitelist) {
add_value(move(name), m_conf.get(m_modname, move(name), move(fallback)), forward<vector<string>>(tags), forward<vector<string>>(whitelist));
string value = m_conf.get(m_modname, name, move(fallback));
add_value(move(name), move(value), forward<vector<string>>(tags), forward<vector<string>>(whitelist));
}
void module_formatter::add_optional(string name, vector<string>&& tags, vector<string>&& whitelist) {
if (m_conf.has(m_modname, name)) {
add_value(move(name), m_conf.get(m_modname, move(name)), move(tags), move(whitelist));
string value = m_conf.get(m_modname, name);
add_value(move(name), move(value), move(tags), move(whitelist));
}
}