Skip to content

Commit 6732e54

Browse files
authored
TypeCombinator: prevent unnecessary work
1 parent 6589d03 commit 6732e54

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Type/TypeCombinator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,13 +814,13 @@ private static function processArrayTypes(array $arrayTypes): array
814814
foreach ($constantArrays as $constantArray) {
815815
$valueTypes = $constantArray->getValueTypes();
816816
foreach ($constantArray->getKeyTypes() as $i => $keyType) {
817-
$keyTypesForGeneralArray[] = $keyType;
818817
$valueTypesForGeneralArray[] = $valueTypes[$i];
819818

820819
$keyTypeValue = $keyType->getValue();
821820
if (array_key_exists($keyTypeValue, $constantKeyTypesNumbered)) {
822821
continue;
823822
}
823+
$keyTypesForGeneralArray[] = $keyType;
824824

825825
$constantKeyTypesNumbered[$keyTypeValue] = $nextConstantKeyTypeIndex;
826826
$nextConstantKeyTypeIndex *= 2;

0 commit comments

Comments
 (0)