Skip to content

Commit 8e64ac9

Browse files
tsegismontMulgish
andauthored
Optimize readDir where filtering is required (#5810) (#5821)
* Switch to Java NIO for readDirInternal * Revert "Switch to Java NIO for readDirInternal" This reverts commit ab7601f. * Tactical fix Co-authored-by: Juri Duval <27741935+Mulgish@users.noreply.github.com>
1 parent 2344e3e commit 8e64ac9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/io/vertx/core/file/impl/FileSystemImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,9 +1031,10 @@ public List<String> perform() {
10311031
} else {
10321032
FilenameFilter fnFilter;
10331033
if (filter != null) {
1034+
Pattern fnPattern = Pattern.compile(filter);
10341035
fnFilter = new FilenameFilter() {
10351036
public boolean accept(File dir, String name) {
1036-
return Pattern.matches(filter, name);
1037+
return fnPattern.matcher(name).matches();
10371038
}
10381039
};
10391040
} else {

0 commit comments

Comments
 (0)