protocol/RangeArg: eliminate SetAll()

This commit is contained in:
Max Kellermann 2018-09-02 07:53:32 +02:00
parent 993f8d6a5e
commit 590687fdea
2 changed files with 2 additions and 8 deletions

View File

@ -74,14 +74,13 @@ ParseSortTag(const char *s)
static CommandResult
handle_match(Client &client, Request args, Response &r, bool fold_case)
{
RangeArg window;
RangeArg window = RangeArg::All();
if (args.size >= 2 && StringIsEqual(args[args.size - 2], "window")) {
window = args.ParseRange(args.size - 1);
args.pop_back();
args.pop_back();
} else
window.SetAll();
}
TagType sort = TAG_NUM_OF_ITEM_TYPES;
bool descending = false;

View File

@ -27,11 +27,6 @@
struct RangeArg {
unsigned start, end;
void SetAll() {
start = 0;
end = std::numeric_limits<unsigned>::max();
}
static constexpr RangeArg All() {
return { 0, std::numeric_limits<unsigned>::max() };
}