mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-02 05:41:16 -03:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user