From eedd37c09acace58ceadacf8ecf9e883a2fd5a4a Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 26 Jul 2013 01:17:12 +0200 Subject: memoryview: always pass by value --- src/command_manager.hh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/command_manager.hh') diff --git a/src/command_manager.hh b/src/command_manager.hh index 2c272f03..c63633ef 100644 --- a/src/command_manager.hh +++ b/src/command_manager.hh @@ -21,10 +21,10 @@ struct parse_error : runtime_error struct Context; using CommandParameters = memoryview; -using Command = std::function; using CommandCompleter = std::function; class PerArgumentCommandCompleter @@ -34,11 +34,11 @@ public: const String&, ByteCount)>; using ArgumentCompleterList = memoryview; - PerArgumentCommandCompleter(const ArgumentCompleterList& completers) + PerArgumentCommandCompleter(ArgumentCompleterList completers) : m_completers(completers.begin(), completers.end()) {} CandidateList operator()(const Context& context, - const CommandParameters& params, + CommandParameters params, size_t token_to_complete, ByteCount pos_in_token) const; @@ -50,7 +50,7 @@ class CommandManager : public Singleton { public: void execute(const String& command_line, Context& context, - const memoryview& shell_params = {}, + memoryview shell_params = {}, const EnvVarMap& env_vars = EnvVarMap{}); Completions complete(const Context& context, @@ -62,12 +62,12 @@ public: Command command, CommandCompleter completer = CommandCompleter()); - void register_commands(const memoryview& command_names, + void register_commands(memoryview command_names, Command command, CommandCompleter completer = CommandCompleter()); private: - void execute_single_command(const CommandParameters& params, + void execute_single_command(CommandParameters params, Context& context) const; struct CommandDescriptor { -- cgit v1.2.3