From bafc321e791d5e05517ec16ab0ad2f38fe0f8da2 Mon Sep 17 00:00:00 2001 From: Marco Biasini <marco.biasini@unibas.ch> Date: Thu, 8 Dec 2011 13:45:28 +0100 Subject: [PATCH] speed up queries Queries like 'rname=GLY and aname=CA' get faster by 5x. Sometimes it's a good idea to review old code... --- modules/mol/base/src/impl/query_impl.cc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/modules/mol/base/src/impl/query_impl.cc b/modules/mol/base/src/impl/query_impl.cc index a70cfa813..965f1dbe4 100644 --- a/modules/mol/base/src/impl/query_impl.cc +++ b/modules/mol/base/src/impl/query_impl.cc @@ -283,12 +283,7 @@ bool QueryImpl::IsAlwaysUndef(const Node* ast, if (lop_node) { bool lhs = this->IsAlwaysUndef(lop_node->GetLHS(), target_level); bool rhs = this->IsAlwaysUndef(lop_node->GetRHS(), target_level); - switch (lop_node->GetOP()) { - case LOP_AND: - return lhs || rhs; - case LOP_OR: - return lhs && rhs; - } + return lhs && rhs; } else { const SelNode* sel_node = dynamic_cast<const SelNode*>(ast); -- GitLab