From 21a29866357c043c302785a51e5838fffade8ccd Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 14 Oct 2015 16:52:01 +0200 Subject: [PATCH] Avoid evaluating unnecessary filters refs #10360 --- lib/remote/filterutility.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/remote/filterutility.cpp b/lib/remote/filterutility.cpp index 5070e2771..f48510699 100644 --- a/lib/remote/filterutility.cpp +++ b/lib/remote/filterutility.cpp @@ -231,12 +231,6 @@ std::vector FilterUtility::GetFilterTargets(const QueryDescription& qd, c if (!query->Contains("type")) BOOST_THROW_EXCEPTION(std::invalid_argument("Type must be specified when using a filter.")); - String filter; - if (!query->Contains("filter")) - filter = "true"; - else - filter = HttpUtility::GetLastParameter(query, "filter"); - String type = HttpUtility::GetLastParameter(query, "type"); if (!provider->IsValidType(type)) @@ -249,7 +243,12 @@ std::vector FilterUtility::GetFilterTargets(const QueryDescription& qd, c frame.Sandboxed = true; Dictionary::Ptr uvars = new Dictionary(); - Expression *ufilter = ConfigCompiler::CompileText("", filter); + Expression *ufilter = NULL; + + if (query->Contains("filter")) { + String filter = HttpUtility::GetLastParameter(query, "filter"); + ufilter = ConfigCompiler::CompileText("", filter); + } Dictionary::Ptr filter_vars = query->Get("filter_vars"); if (filter_vars) { -- 2.40.0