Skip to content

Commit

Permalink
Remove unused vars identified by lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurtis Rader committed Aug 18, 2017
1 parent f872f25 commit 55b2d36
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 100 deletions.
3 changes: 1 addition & 2 deletions src/builtin_complete.cpp
Expand Up @@ -318,8 +318,7 @@ int builtin_complete(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
recursion_level++;

std::vector<completion_t> comp;
complete(do_complete_param, &comp, COMPLETION_REQUEST_DEFAULT,
env_vars_snapshot_t::current());
complete(do_complete_param, &comp, COMPLETION_REQUEST_DEFAULT);

for (size_t i = 0; i < comp.size(); i++) {
const completion_t &next = comp.at(i);
Expand Down
9 changes: 3 additions & 6 deletions src/complete.cpp
Expand Up @@ -28,7 +28,6 @@
#include "builtin.h"
#include "common.h"
#include "complete.h"
#include "env.h"
#include "exec.h"
#include "expand.h"
#include "fallback.h" // IWYU pragma: keep
Expand Down Expand Up @@ -290,7 +289,6 @@ class completer_t {
const completion_request_flags_t flags;
const wcstring initial_cmd;
std::vector<completion_t> completions;
const env_vars_snapshot_t &vars; // transient, stack-allocated

/// Table of completions conditions that have already been tested and the corresponding test
/// results.
Expand All @@ -316,8 +314,7 @@ class completer_t {
}

public:
completer_t(const wcstring &c, completion_request_flags_t f, const env_vars_snapshot_t &evs)
: flags(f), initial_cmd(c), vars(evs) {}
completer_t(const wcstring &c, completion_request_flags_t f) : flags(f), initial_cmd(c) {}

bool empty() const { return completions.empty(); }
const std::vector<completion_t> &get_completions(void) { return completions; }
Expand Down Expand Up @@ -1238,7 +1235,7 @@ bool completer_t::try_complete_user(const wcstring &str) {
}

void complete(const wcstring &cmd_with_subcmds, std::vector<completion_t> *out_comps,
completion_request_flags_t flags, const env_vars_snapshot_t &vars) {
completion_request_flags_t flags) {
// Determine the innermost subcommand.
const wchar_t *cmdsubst_begin, *cmdsubst_end;
parse_util_cmdsubst_extent(cmd_with_subcmds.c_str(), cmd_with_subcmds.size(), &cmdsubst_begin,
Expand All @@ -1247,7 +1244,7 @@ void complete(const wcstring &cmd_with_subcmds, std::vector<completion_t> *out_c
const wcstring cmd = wcstring(cmdsubst_begin, cmdsubst_end - cmdsubst_begin);

// Make our completer.
completer_t completer(cmd, flags, vars);
completer_t completer(cmd, flags);

wcstring current_command;
const size_t pos = cmd.size();
Expand Down
3 changes: 1 addition & 2 deletions src/complete.h
Expand Up @@ -157,9 +157,8 @@ void complete_remove(const wcstring &cmd, bool cmd_is_path, const wcstring &opti
void complete_remove_all(const wcstring &cmd, bool cmd_is_path);

/// Find all completions of the command cmd, insert them into out.
class env_vars_snapshot_t;
void complete(const wcstring &cmd, std::vector<completion_t> *out_comps,
completion_request_flags_t flags, const env_vars_snapshot_t &vars);
completion_request_flags_t flags);

/// Return a list of all current completions.
wcstring complete_print();
Expand Down

0 comments on commit 55b2d36

Please sign in to comment.