Skip to content

Commit

Permalink
Minor optimization.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jun 19, 2020
1 parent bacbadd commit cdd94a3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/Operation/Combine.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ public function __invoke(): Closure
$keysIterator->next();
}

$predicate1 = (true === $original->valid() && false === $keysIterator->valid());
$predicate2 = (false === $original->valid() && true === $keysIterator->valid());

if ($predicate1 || $predicate2) {
if ($original->valid() !== $keysIterator->valid()) {
trigger_error('Both keys and values must have the same amount of items.', E_USER_WARNING);
}
};
Expand Down

0 comments on commit cdd94a3

Please sign in to comment.