Skip to content

Commit

Permalink
Faster FileInfoMatcher (#196)
Browse files Browse the repository at this point in the history
RealpathMatcher cannot resolve wildcards -> early return to prevent unnecessary IO
  • Loading branch information
staabm committed Apr 19, 2024
1 parent 58daa82 commit cfa7d5b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Skipper/Matcher/FileInfoMatcher.php
Expand Up @@ -61,6 +61,11 @@ private function doesFileInfoMatchPattern(SplFileInfo | string $file, string $ig
return true;
}

// realpathMatcher cannot resolve wildcards -> return early to prevent unnecessary IO
if (str_contains($ignoredPath, '*')) {
return false;
}

return $this->realpathMatcher->match($ignoredPath, $filePath);
}
}

0 comments on commit cfa7d5b

Please sign in to comment.