Hash :
f28a2482
Author :
Date :
2009-08-12T19:03:07
Optimize exclude: use hash tables for non-wildcard patterns. * lib/exclude.c: Include hash.h and mbuiter.h (struct exclude_pattern, exclude_segment): New data types. (struct exclude): Rewrite. (fnmatch_pattern_has_wildcards): New function. (new_exclude_segment, free_exclude_segment): New functions. (excluded_file_pattern_p, excluded_file_name_p): New functions. (excluded_file_name, add_exclude): Rewrite using new struct exclude. * lib/exclude.h (is_fnmatch_pattern): New prototype. * modules/exclude: Depend on hash and mbuiter. * modules/exclude-tests: New file. * tests/test-exclude.c: New file. * tests/test-exclude1.sh: New file. * tests/test-exclude2.sh: New file. * tests/test-exclude3.sh: New file. * tests/test-exclude4.sh: New file. * tests/test-exclude5.sh: New file. * tests/test-exclude6.sh: New file. * tests/test-exclude7.sh: New file.
Files:
tests/test-exclude.c
tests/test-exclude1.sh
tests/test-exclude2.sh
tests/test-exclude3.sh
tests/test-exclude4.sh
tests/test-exclude5.sh
tests/test-exclude6.sh
tests/test-exclude7.sh
Depends-on:
progname
error
argmatch
Makefile.am:
TESTS += \
test-exclude1.sh\
test-exclude2.sh\
test-exclude3.sh\
test-exclude4.sh\
test-exclude5.sh\
test-exclude6.sh\
test-exclude7.sh
TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@'
check_PROGRAMS += test-exclude
test_exclude_LDADD = $(LDADD) @LIBINTL@