From a8452957fc9bf6ef87bc25151247da9a5df06e56 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 9 Aug 2022 12:43:13 +0200 Subject: [PATCH] command/Request: pass std::span to constructor --- src/command/AllCommands.cxx | 2 +- src/command/Request.hxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/command/AllCommands.cxx b/src/command/AllCommands.cxx index 1148cad04..34f790954 100644 --- a/src/command/AllCommands.cxx +++ b/src/command/AllCommands.cxx @@ -421,7 +421,7 @@ command_process(Client &client, unsigned num, char *line) noexcept argv[n_args++] = a; } - Request args{argv, n_args}; + Request args{{argv, n_args}}; /* look up and invoke the command handler */ diff --git a/src/command/Request.hxx b/src/command/Request.hxx index 59a608643..d1a9e29fc 100644 --- a/src/command/Request.hxx +++ b/src/command/Request.hxx @@ -34,8 +34,8 @@ class Request { std::span args; public: - explicit constexpr Request(const char *const*argv, std::size_t n) - :args(argv, n) {} + explicit constexpr Request(std::span _args) noexcept + :args(_args) {} constexpr bool empty() const noexcept { return args.empty();