Skip to content

Commit

Permalink
Prevent unnecessary ExecutionOrderDependency->getTarget() call
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm authored and sebastianbergmann committed Mar 12, 2024
1 parent 3299d8c commit 9b96926
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Framework/ExecutionOrderDependency.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,13 @@ public static function mergeUnique(array $existing, array $additional): array
);

foreach ($additional as $dependency) {
if (in_array($dependency->getTarget(), $existingTargets, true)) {
$additionalTarget = $dependency->getTarget();

if (in_array($additionalTarget, $existingTargets, true)) {
continue;
}

$existingTargets[] = $dependency->getTarget();
$existingTargets[] = $additionalTarget;
$existing[] = $dependency;
}

Expand Down

0 comments on commit 9b96926

Please sign in to comment.