Skip to content

Commit

Permalink
Faster FileInfoMatcher (#5830)
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 authored Apr 19, 2024
1 parent 25c1b43 commit 38b3c20
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 doesFileMatchPattern(string $filePath, string $ignoredPath): bo
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 38b3c20

Please sign in to comment.