Skip to content

Commit 4919e11

Browse files
committed
[Intl] Use cache in EmojiTransliterator::listIDs
1 parent 463c90e commit 4919e11

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Symfony/Component/Intl/Transliterator/EmojiTransliterator.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,11 @@ public function getErrorMessage(): string|false
106106

107107
public static function listIDs(): array
108108
{
109-
static $ids;
109+
static $ids = [];
110110

111-
$ids = [];
111+
if ($ids) {
112+
return $ids;
113+
}
112114

113115
foreach (scandir(\dirname(__DIR__).'/Resources/data/transliterator/emoji/') as $file) {
114116
if (str_ends_with($file, '.php')) {

0 commit comments

Comments
 (0)