From 8ab7ed7aa5f46394124a714c7a80dcdc5547ce7a Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Thu, 4 Aug 2016 15:37:30 -0500 Subject: [PATCH] Minor optimization --- opencog/query/PatternMatch.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opencog/query/PatternMatch.cc b/opencog/query/PatternMatch.cc index 106f465993..061a9fcacd 100644 --- a/opencog/query/PatternMatch.cc +++ b/opencog/query/PatternMatch.cc @@ -379,14 +379,14 @@ bool PatternLink::satisfy(PatternMatchCallback& pmcb) const LAZY_LOG_FINE << "BEGIN COMPONENT GROUNDING " << i+1 << " of " << _num_comps << ": ===========\n"; - Pattern pat = PatternLinkCast(_component_patterns.at(i))->get_pattern(); + PatternLinkPtr clp(PatternLinkCast(_component_patterns.at(i))); + Pattern pat = clp->get_pattern(); bool is_pure_optional = false; if (pat.mandatory.size() == 0 and pat.optionals.size() > 0) is_pure_optional = true; // Pass through the callbacks, collect up answers. PMCGroundings gcb(pmcb); - PatternLinkPtr clp(PatternLinkCast(_component_patterns.at(i))); clp->satisfy(gcb); // Special handling for disconnected pure optionals -- Returns false to