From 76f8642feb2d54d8d46a2e07c17ec3c538a4de6f Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Wed, 6 Jun 2012 15:50:29 +0200 Subject: [PATCH] Remove duplicate function from decisions --- src/Composer/DependencyResolver/Decisions.php | 10 ---------- src/Composer/DependencyResolver/RuleWatchGraph.php | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/Composer/DependencyResolver/Decisions.php b/src/Composer/DependencyResolver/Decisions.php index 77289169b..451cb5ff7 100644 --- a/src/Composer/DependencyResolver/Decisions.php +++ b/src/Composer/DependencyResolver/Decisions.php @@ -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) { $packageId = abs($literal); diff --git a/src/Composer/DependencyResolver/RuleWatchGraph.php b/src/Composer/DependencyResolver/RuleWatchGraph.php index 42c764fa6..72b288e15 100644 --- a/src/Composer/DependencyResolver/RuleWatchGraph.php +++ b/src/Composer/DependencyResolver/RuleWatchGraph.php @@ -94,7 +94,7 @@ class RuleWatchGraph $node = $chain->current(); $otherWatch = $node->getOtherWatch($literal); - if (!$node->getRule()->isDisabled() && !$decisions->contain($otherWatch)) { + if (!$node->getRule()->isDisabled() && !$decisions->satisfy($otherWatch)) { $ruleLiterals = $node->getRule()->getLiterals(); $alternativeLiterals = array_filter($ruleLiterals, function ($ruleLiteral) use ($literal, $otherWatch, $decisions) {