command/Request: pass std::span to constructor

This commit is contained in:
Max Kellermann 2022-08-09 12:43:13 +02:00
parent feb334756e
commit a8452957fc
2 changed files with 3 additions and 3 deletions

View File

@ -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 */

View File

@ -34,8 +34,8 @@ class Request {
std::span<const char *const> args;
public:
explicit constexpr Request(const char *const*argv, std::size_t n)
:args(argv, n) {}
explicit constexpr Request(std::span<const char *const> _args) noexcept
:args(_args) {}
constexpr bool empty() const noexcept {
return args.empty();