From: Thomas Gummerer Date: Fri, 6 Jul 2012 16:07:30 +0000 (+0200) Subject: Replace strlen() with ce_namelen() X-Git-Tag: v1.7.12-rc0~38^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=68c4f6a57759233ef4586f27d424721c6c1c0ea7;p=git.git Replace strlen() with ce_namelen() Replace strlen(ce->name) with ce_namelen() in a couple of places which gives us some additional bits of performance. Signed-off-by: Thomas Gummerer Signed-off-by: Junio C Hamano --- diff --git a/read-cache.c b/read-cache.c index ef355cc9a..1df6adf0b 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1119,7 +1119,7 @@ int refresh_index(struct index_state *istate, unsigned int flags, const char **p continue; if (pathspec && - !match_pathspec(pathspec, ce->name, strlen(ce->name), 0, seen)) + !match_pathspec(pathspec, ce->name, ce_namelen(ce), 0, seen)) filtered = 1; if (ce_stage(ce)) { @@ -1841,7 +1841,7 @@ int read_index_unmerged(struct index_state *istate) if (!ce_stage(ce)) continue; unmerged = 1; - len = strlen(ce->name); + len = ce_namelen(ce); size = cache_entry_size(len); new_ce = xcalloc(1, size); memcpy(new_ce->name, ce->name, len); diff --git a/unpack-trees.c b/unpack-trees.c index 33a581924..29893bf65 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -1296,7 +1296,7 @@ static int verify_clean_subdirectory(struct cache_entry *ce, * First let's make sure we do not have a local modification * in that directory. */ - namelen = strlen(ce->name); + namelen = ce_namelen(ce); for (i = locate_in_src_index(ce, o); i < o->src_index->cache_nr; i++) {