From f794cea6e7d095010aaa82e0108acaf511184cf8 Mon Sep 17 00:00:00 2001 From: djcb Date: Sat, 4 Nov 2017 14:32:41 +0200 Subject: [PATCH] parser: small regex optimization --- lib/parser/parser.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/parser/parser.cc b/lib/parser/parser.cc index 78413f1f..17f331ce 100644 --- a/lib/parser/parser.cc +++ b/lib/parser/parser.cc @@ -104,7 +104,11 @@ regex (const ProcIface::FieldInfoVec& fields, const std::string& v, field.id, term)})); } } - return tree; + + if (tree.children.empty()) + return empty(); + else + return tree; } catch (...) { // fallback