Skip to content

Commit

Permalink
Minor optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
linas committed Aug 4, 2016
1 parent 711fb5c commit 8ab7ed7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions opencog/query/PatternMatch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8ab7ed7

Please sign in to comment.