Constructors to accept more parameters by value

In cases where the constructor needs to take ownership of parameters,
pass them by value and use std::move.
This commit is contained in:
ridiculousfish
2018-02-18 18:39:03 -08:00
parent 74e6a82849
commit da84b38430
19 changed files with 53 additions and 47 deletions

View File

@@ -46,9 +46,9 @@ file_access_attempt_t access_file(const wcstring &path, int mode) {
return result;
}
autoload_t::autoload_t(const wcstring &env_var_name_var,
autoload_t::autoload_t(wcstring env_var_name_var,
command_removed_function_t cmd_removed_callback)
: env_var_name(env_var_name_var), command_removed(cmd_removed_callback) {}
: env_var_name(std::move(env_var_name_var)), command_removed(cmd_removed_callback) {}
void autoload_t::entry_was_evicted(wcstring key, autoload_function_t node) {
// This should only ever happen on the main thread.