From 6a03e4f9ac5992987914baa92ab6d81028919552 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sun, 14 Oct 2012 16:57:44 +0200 Subject: [PATCH] Code optimizations: Avoiding counting repeatedly --- src/Composer/DependencyResolver/Solver.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Composer/DependencyResolver/Solver.php b/src/Composer/DependencyResolver/Solver.php index c0a09f16b..2ad3965fe 100644 --- a/src/Composer/DependencyResolver/Solver.php +++ b/src/Composer/DependencyResolver/Solver.php @@ -53,7 +53,8 @@ class Solver { $decisionStart = count($this->decisions) - 1; - for ($ruleIndex = 0; $ruleIndex < count($this->rules); $ruleIndex++) { + $rulesCount = count($this->rules); + for ($ruleIndex = 0; $ruleIndex < $rulesCount; $ruleIndex++) { $rule = $this->rules->ruleById($ruleIndex); if (!$rule->isAssertion() || $rule->isDisabled()) {