Skip to content

Commit e62571c

Browse files
authored
Refator array_map into simple loop for performance. (#11332)
1 parent 98f9de2 commit e62571c

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
@@ -1781,18 +1781,15 @@ public function addToIdentityMap($entity)
17811781
*/
17821782
final public static function getIdHashByIdentifier(array $identifier): string
17831783
{
1784+
foreach ($identifier as $k => $value) {
1785+
if ($value instanceof BackedEnum) {
1786+
$identifier[$k] = $value->value;
1787+
}
1788+
}
1789+
17841790
return implode(
17851791
' ',
1786-
array_map(
1787-
static function ($value) {
1788-
if ($value instanceof BackedEnum) {
1789-
return $value->value;
1790-
}
1791-
1792-
return $value;
1793-
},
1794-
$identifier
1795-
)
1792+
$identifier
17961793
);
17971794
}
17981795

0 commit comments

Comments
 (0)