1
0
Fork 0

Remove duplicate function from decisions

pull/779/head
Nils Adermann 2012-06-06 15:50:29 +02:00
parent 5b1a48663e
commit 76f8642feb
2 changed files with 1 additions and 11 deletions

View File

@ -46,16 +46,6 @@ class Decisions implements \Iterator, \Countable
); );
} }
public function contain($literal)
{
$packageId = abs($literal);
return (
$this->decisionMap[$packageId] > 0 && $literal > 0 ||
$this->decisionMap[$packageId] < 0 && $literal < 0
);
}
public function satisfy($literal) public function satisfy($literal)
{ {
$packageId = abs($literal); $packageId = abs($literal);

View File

@ -94,7 +94,7 @@ class RuleWatchGraph
$node = $chain->current(); $node = $chain->current();
$otherWatch = $node->getOtherWatch($literal); $otherWatch = $node->getOtherWatch($literal);
if (!$node->getRule()->isDisabled() && !$decisions->contain($otherWatch)) { if (!$node->getRule()->isDisabled() && !$decisions->satisfy($otherWatch)) {
$ruleLiterals = $node->getRule()->getLiterals(); $ruleLiterals = $node->getRule()->getLiterals();
$alternativeLiterals = array_filter($ruleLiterals, function ($ruleLiteral) use ($literal, $otherWatch, $decisions) { $alternativeLiterals = array_filter($ruleLiterals, function ($ruleLiteral) use ($literal, $otherWatch, $decisions) {