summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-07-13 15:37:58 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-07-13 15:37:58 -0700
commit4495f88cd84abd5e6fb5f601c451ca87ddb98929 (patch)
tree2407381abb8d2f5367326e79e303694ac10b6757
parentMerge branch 'tb/sanitize-decomposed-utf-8-pathname' (diff)
parentReplace strlen() with ce_namelen() (diff)
downloadtgif-4495f88cd84abd5e6fb5f601c451ca87ddb98929.tar.xz
Merge branch 'tg/ce-namelen'
Trivially correct clean-up and micro optimization. * tg/ce-namelen: Replace strlen() with ce_namelen()
-rw-r--r--read-cache.c4
-rw-r--r--unpack-trees.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/read-cache.c b/read-cache.c
index ef355cc9a8..1df6adf0bf 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 33a581924e..29893bf659 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++) {