Skip to content

Commit

Permalink
Faster FileInfoMatcher
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 0a72d73
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Skipper/Matcher/FileInfoMatcher.php
Original file line number Diff line number Diff line change
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 0a72d73

Please sign in to comment.