Skip to content

Commit 56ac3e2

Browse files
Performance improvement
1 parent 71eb7e7 commit 56ac3e2

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

Symfony/CS/UniqueFileIterator.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,14 @@ public function accept()
2727
/** @var SplFileInfo $file */
2828
$file = $this->current();
2929

30-
if ($file->isDir() || $file->isLink()) {
31-
return false;
32-
}
33-
3430
$path = $file->getRealPath();
3531

36-
if (array_key_exists($path, $this->visitedElements)) {
32+
if (isset($this->visitedElements[$path])) {
3733
return false;
3834
}
3935

40-
$this->visitedElements[$path] = null;
36+
$this->visitedElements[$path] = true;
4137

42-
return true;
38+
return !$file->isDir() && !$file->isLink();
4339
}
4440
}

0 commit comments

Comments
 (0)