From 50565cb0c8bbdc9be17e6c1452b4f856a28b3be0 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Thu, 12 Jul 2018 20:44:24 +0200 Subject: [PATCH] Use variable to call count() less often --- src/Composer/DependencyResolver/RuleWatchNode.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Composer/DependencyResolver/RuleWatchNode.php b/src/Composer/DependencyResolver/RuleWatchNode.php index 3d31a38c5..eeaa54162 100644 --- a/src/Composer/DependencyResolver/RuleWatchNode.php +++ b/src/Composer/DependencyResolver/RuleWatchNode.php @@ -37,8 +37,9 @@ class RuleWatchNode $literals = $rule->getLiterals(); - $this->watch1 = count($literals) > 0 ? $literals[0] : 0; - $this->watch2 = count($literals) > 1 ? $literals[1] : 0; + $literalCount = count($literals); + $this->watch1 = $literalCount > 0 ? $literals[0] : 0; + $this->watch2 = $literalCount > 1 ? $literals[1] : 0; } /**