summaryrefslogtreecommitdiff
path: root/apt-pkg/cachefilter-patterns.h
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2020-02-01 17:04:58 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2020-02-03 12:54:42 +0100
commitbcb9ecb2cd2208d12b83c4e111be7c126b49dc7e (patch)
tree8987ecc069ec9d77254897c16f83fa6412b22575 /apt-pkg/cachefilter-patterns.h
parent2746cd503accc4d995a9c11f294dbbc560997292 (diff)
patterns: Provide Node constructor, simplify error throwing
By having a node constructor, we can construct a node inline for error reporting needs, simplifying the code a bit.
Diffstat (limited to 'apt-pkg/cachefilter-patterns.h')
-rw-r--r--apt-pkg/cachefilter-patterns.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/apt-pkg/cachefilter-patterns.h b/apt-pkg/cachefilter-patterns.h
index 33595dde2..8317665bc 100644
--- a/apt-pkg/cachefilter-patterns.h
+++ b/apt-pkg/cachefilter-patterns.h
@@ -39,6 +39,8 @@ struct PatternTreeParser
size_t start = 0;
size_t end = 0;
+ explicit Node(size_t start = 0, size_t end = 0) : start(start), end(end) {}
+
virtual std::ostream &render(std::ostream &os) { return os; };
std::nullptr_t error(std::string message);
};