Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various small speed improvements #106

Merged
merged 5 commits into from Nov 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/main/java/org/codehaus/plexus/util/AbstractScanner.java
Expand Up @@ -246,7 +246,7 @@ public void setIncludes( String[] includes )
list.add( normalizePattern( include ) );
}
}
this.includes = list.toArray( new String[list.size()] );
this.includes = list.toArray( new String[0] );
}
}

Expand Down Expand Up @@ -276,7 +276,7 @@ public void setExcludes( String[] excludes )
list.add( normalizePattern( exclude ) );
}
}
this.excludes = list.toArray( new String[list.size()] );
this.excludes = list.toArray( new String[0] );
}
}

Expand Down Expand Up @@ -331,6 +331,11 @@ protected boolean isIncluded( String name, String[] tokenizedName )
return includesPatterns.matches( name, tokenizedName, isCaseSensitive );
}

protected boolean isIncluded( String name, char[][] tokenizedName )
{
return includesPatterns.matches( name, tokenizedName, isCaseSensitive );
}

/**
* Tests whether or not a name matches the start of at least one include pattern.
*
Expand Down Expand Up @@ -360,6 +365,11 @@ protected boolean isExcluded( String name, String[] tokenizedName )
return excludesPatterns.matches( name, tokenizedName, isCaseSensitive );
}

protected boolean isExcluded( String name, char[][] tokenizedName )
{
return excludesPatterns.matches( name, tokenizedName, isCaseSensitive );
}

/**
* Adds default exclusions to the current exclusions set.
*/
Expand Down