From: Chuck Lever Date: Mon, 12 Sep 2005 14:56:22 GMT Subject: [PATCH 18/22] teach diff.c to use cache_find_name() Message-ID: <20050912145622.28120.62972.stgit@dexter.citi.umich.edu> In-Reply-To: <20050912145543.28120.7086.stgit@dexter.citi.umich.edu> Signed-off-by: Chuck Lever --- diff.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/diff.c b/diff.c --- a/diff.c +++ b/diff.c @@ -244,7 +244,6 @@ static int work_tree_matches(const char { struct cache_entry *ce; struct stat st; - int pos, len; /* We do not read the cache ourselves here, because the * benchmark with my previous version that always reads cache @@ -261,11 +260,8 @@ static int work_tree_matches(const char if (read_cache_needed()) return 0; - len = strlen(name); - pos = cache_name_pos(name, len); - if (pos < 0) + if (!cache_find_entry(name, strlen(name), &ce)) return 0; - ce = active_cache[pos]; if ((lstat(name, &st) < 0) || !S_ISREG(st.st_mode) || /* careful! */ ce_match_stat(ce, &st) ||