Skip to content

Commit 507c73c

Browse files
committed
Merge branch '2.19.x' into 3.1.x
* 2.19.x: Refator array_map into simple loop for performance. (#11332)
2 parents ba0ea89 + e62571c commit 507c73c

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/UnitOfWork.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,18 +1557,15 @@ public function addToIdentityMap(object $entity): bool
15571557
*/
15581558
final public static function getIdHashByIdentifier(array $identifier): string
15591559
{
1560+
foreach ($identifier as $k => $value) {
1561+
if ($value instanceof BackedEnum) {
1562+
$identifier[$k] = $value->value;
1563+
}
1564+
}
1565+
15601566
return implode(
15611567
' ',
1562-
array_map(
1563-
static function ($value) {
1564-
if ($value instanceof BackedEnum) {
1565-
return $value->value;
1566-
}
1567-
1568-
return $value;
1569-
},
1570-
$identifier,
1571-
),
1568+
$identifier,
15721569
);
15731570
}
15741571

0 commit comments

Comments
 (0)