Commit 8cafa9a6 authored by Kamal Marhubi's avatar Kamal Marhubi

Templatize consumeWhile to avoid virtual call overhead

parent c4e7ed8c
......@@ -504,7 +504,8 @@ public:
advance(expected.size());
}
kj::ArrayPtr<const char> consumeWhile(kj::Function<bool(char)> predicate) {
template <typename Predicate>
kj::ArrayPtr<const char> consumeWhile(Predicate&& predicate) {
auto originalPos = remaining_.begin();
while (predicate(nextChar())) { advance(); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment