mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 09:58:54 +08:00
[clang-tidy] Use std::move
Found with modernize-pass-by-value
This commit is contained in:
parent
49fbca8a8b
commit
5d1ad8de91
@ -901,10 +901,10 @@ class literal_replacer_t : public string_replacer_t {
|
||||
size_t patlen;
|
||||
|
||||
public:
|
||||
literal_replacer_t(const wchar_t *argv0, const wcstring &pattern_, const wchar_t *replacement_,
|
||||
literal_replacer_t(const wchar_t *argv0, wcstring pattern_, const wchar_t *replacement_,
|
||||
const options_t &opts, io_streams_t &streams)
|
||||
: string_replacer_t(argv0, opts, streams),
|
||||
pattern(pattern_),
|
||||
pattern(std::move(pattern_)),
|
||||
replacement(replacement_),
|
||||
patlen(pattern.length()) {}
|
||||
|
||||
|
@ -266,7 +266,7 @@ class combining_expression : public expression {
|
||||
const std::vector<token_t> combiners;
|
||||
|
||||
combining_expression(token_t tok, range_t where, std::vector<unique_ptr<expression>> exprs,
|
||||
const std::vector<token_t> &combs)
|
||||
std::vector<token_t> combs)
|
||||
: expression(tok, where), subjects(std::move(exprs)), combiners(std::move(combs)) {
|
||||
// We should have one more subject than combiner.
|
||||
assert(subjects.size() == combiners.size() + 1);
|
||||
|
@ -389,9 +389,9 @@ class completer_t {
|
||||
const std::vector<tok_t> &args);
|
||||
|
||||
public:
|
||||
completer_t(const environment_t &vars, const std::shared_ptr<parser_t> &parser, wcstring c,
|
||||
completer_t(const environment_t &vars, std::shared_ptr<parser_t> parser, wcstring c,
|
||||
completion_request_flags_t f)
|
||||
: vars(vars), parser(parser), cmd(std::move(c)), flags(f) {}
|
||||
: vars(vars), parser(std::move(parser)), cmd(std::move(c)), flags(f) {}
|
||||
|
||||
void perform();
|
||||
|
||||
|
@ -860,9 +860,9 @@ class expander_t {
|
||||
expand_result_t stage_home_and_self(wcstring input, std::vector<completion_t> *out);
|
||||
expand_result_t stage_wildcards(wcstring path_to_expand, std::vector<completion_t> *out);
|
||||
|
||||
expander_t(const environment_t &vars, const std::shared_ptr<parser_t> &parser,
|
||||
expand_flags_t flags, parse_error_list_t *errors)
|
||||
: vars(vars), parser(parser), flags(flags), errors(errors) {}
|
||||
expander_t(const environment_t &vars, std::shared_ptr<parser_t> parser, expand_flags_t flags,
|
||||
parse_error_list_t *errors)
|
||||
: vars(vars), parser(std::move(parser)), flags(flags), errors(errors) {}
|
||||
|
||||
public:
|
||||
static expand_result_t expand_string(wcstring input, std::vector<completion_t> *out_completions,
|
||||
|
Loading…
x
Reference in New Issue
Block a user