ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: cvs commit: ant/src/main/org/apache/tools/ant/types/selectors
Date Tue, 15 Jul 2003 14:40:18 GMT
On 14 Jul 2003, <> wrote:

>   Optimize DirectoryScanner to take advantage of include patterns
>   which are not beginning with wildcards PR: 20103

I'm not sure I understand what you've done, I'll try to come up with
some unit tests if I think something is wrong 8-)

Some notes:

* SelectorUtils#rtrimWildcardTokens should probably short circuit and
return the original input if the input doesn't contain any wildcards
at all.

* the same method may become faster if you'd use tokenizePathAsArray
instead of tokenizePath, even though I've never verified any speedup

* You go a long way to avoid redundantly adding patterns in
DirectoryScanner#checkIncludePatterns (the parent check).  If the
patterns come in reversed, you'll still have duplicate roots, no?  Say
a/b/c is added before a/b is.  You may avoid this by sorting the
include patterns first.

* If all patterns are plain files, i.e. no "pattern" contains any
wildcards, things could still be improved by not performing any
pattern matching at all.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message