mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-07-02 17:31: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:
@@ -687,12 +687,12 @@ class highlighter_t {
|
||||
public:
|
||||
// Constructor
|
||||
highlighter_t(const wcstring &str, size_t pos, const env_vars_snapshot_t &ev,
|
||||
const wcstring &wd, bool can_do_io)
|
||||
wcstring wd, bool can_do_io)
|
||||
: buff(str),
|
||||
cursor_pos(pos),
|
||||
vars(ev),
|
||||
io_ok(can_do_io),
|
||||
working_directory(wd),
|
||||
working_directory(std::move(wd)),
|
||||
color_array(str.size()) {
|
||||
// Parse the tree.
|
||||
parse_tree_from_string(buff, parse_flag_continue_after_error | parse_flag_include_comments,
|
||||
|
||||
Reference in New Issue
Block a user