From 68492fc73b7387fa72d09545f5743728c5fdb419 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Sun, 28 Oct 2007 21:27:13 +0100 Subject: Speedup scanning for excluded files. Try to avoid a lot of work scanning for excluded files, by caching some more information when setting up the exclusion data structure. Speeds up 'git runstatus' on a repository containing the Qt sources by 30% and reduces the amount of instructions executed (as measured by valgrind) by a factor of 2. Signed-off-by: Junio C Hamano --- dir.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'dir.h') diff --git a/dir.h b/dir.h index a248a23ac4..aaa247b256 100644 --- a/dir.h +++ b/dir.h @@ -17,13 +17,20 @@ struct dir_entry { char name[FLEX_ARRAY]; /* more */ }; +#define EXC_FLAG_NODIR 1 +#define EXC_FLAG_NOWILDCARD 2 +#define EXC_FLAG_ENDSWITH 4 + struct exclude_list { int nr; int alloc; struct exclude { const char *pattern; + int patternlen; const char *base; int baselen; + int to_exclude; + int flags; } **excludes; }; -- cgit v1.3-5-g45d5