Optimize ignored default paths NO_CI

This commit is contained in:
Dennis Eichhorn 2020-06-09 15:42:13 +02:00 committed by GitHub
parent ddb6099db2
commit 7646f8a909
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,7 +38,7 @@ final class Preloader
* @var string[] * @var string[]
* @since 1.0.0 * @since 1.0.0
*/ */
private array $ignores = []; private array $ignores = ['.', '..'];
/** /**
* Ignore a path or file from preloading * Ignore a path or file from preloading
@ -82,9 +82,7 @@ final class Preloader
public function load() : void public function load() : void
{ {
foreach ($this->includes as $include) { foreach ($this->includes as $include) {
if (\in_array($include, ['.', '..']) if (\in_array($include, $this->ignores)) {
|| \in_array($include, $this->ignores)
) {
continue; continue;
} }
@ -114,9 +112,7 @@ final class Preloader
} }
while ($file = \readdir($fh)) { while ($file = \readdir($fh)) {
if (\in_array($file, ['.', '..']) if (\in_array($file, $this->ignores)) {
|| \in_array($file, $this->ignores)
) {
continue; continue;
} }