From 7646f8a9095a6b816bf1dbce800648c2c3294f3d Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 9 Jun 2020 15:42:13 +0200 Subject: [PATCH] Optimize ignored default paths NO_CI --- Preloader.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Preloader.php b/Preloader.php index 61602bb8a..a8f83e5d2 100644 --- a/Preloader.php +++ b/Preloader.php @@ -38,7 +38,7 @@ final class Preloader * @var string[] * @since 1.0.0 */ - private array $ignores = []; + private array $ignores = ['.', '..']; /** * Ignore a path or file from preloading @@ -82,9 +82,7 @@ final class Preloader public function load() : void { foreach ($this->includes as $include) { - if (\in_array($include, ['.', '..']) - || \in_array($include, $this->ignores) - ) { + if (\in_array($include, $this->ignores)) { continue; } @@ -114,9 +112,7 @@ final class Preloader } while ($file = \readdir($fh)) { - if (\in_array($file, ['.', '..']) - || \in_array($file, $this->ignores) - ) { + if (\in_array($file, $this->ignores)) { continue; }