You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by David Medinets <me...@mtolive.com> on 2000/09/13 23:02:37 UTC

DirectoryScanner Optimization Question

I've been wondering if using a Hashtable instead of a Vector to hold
excluded directories would provide faster lookups. The applicable code is:

    private boolean isExcluded(String name) {
        for (int i = 0; i < excludes.length; i++) {
            if (matchPath(excludes[i],name)) {
                return true;
            }
        }
        return false;
    }

Couldn't the paths of the excluded files be parsed ahead of time to avoid
the need to repeated invoke the matchPath method?



Re: DirectoryScanner Optimization Question

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "DM" == David Medinets <me...@mtolive.com> writes:

 DM> I've been wondering if using a Hashtable instead of a Vector to
 DM> hold excluded directories would provide faster lookups.

Do you mean the directories or the patterns?

I don't think there is much code included that actually uses the
excluded directories - except getExcludedDirectories() which isn't
called by anybody anyway.