Skip to content

Commit 94f3bec

Browse files
committed
move str_replace out of foreach
Always has the same result, so repeated execution was not necessary
1 parent 3fc6455 commit 94f3bec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dev/tools/Magento/Tools/Di/Code/Scanner/DirectoryScanner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ public function scan($dir, array $patterns = [])
2626
continue;
2727
}
2828

29+
$filePath = str_replace('\\', '/', $file->getRealPath());
2930
foreach ($patterns as $type => $pattern) {
30-
$filePath = str_replace('\\', '/', $file->getRealPath());
3131
if (preg_match($pattern, $filePath)) {
3232
$output[$type][] = $filePath;
3333
break;

0 commit comments

Comments
 (0)