summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorThomas Gummerer <t.gummerer@gmail.com>2012-07-06 16:07:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-07-09 02:49:34 (GMT)
commit68c4f6a57759233ef4586f27d424721c6c1c0ea7 (patch)
treea746d0dfbae4352f1351e2ce2e4d1b255b9e519d /read-cache.c
parent8228a23b35f6bd34a87d4d839d06e7c18ae9e750 (diff)
downloadgit-68c4f6a57759233ef4586f27d424721c6c1c0ea7.zip
git-68c4f6a57759233ef4586f27d424721c6c1c0ea7.tar.gz
git-68c4f6a57759233ef4586f27d424721c6c1c0ea7.tar.bz2
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 <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/read-cache.c b/read-cache.c
index ef355cc..1df6adf 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);