Skip to content

Commit 4495f88

Browse files
committed
Merge branch 'tg/ce-namelen'
Trivially correct clean-up and micro optimization. * tg/ce-namelen: Replace strlen() with ce_namelen()
2 parents b856ad6 + 68c4f6a commit 4495f88

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

read-cache.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ int refresh_index(struct index_state *istate, unsigned int flags, const char **p
11191119
continue;
11201120

11211121
if (pathspec &&
1122-
!match_pathspec(pathspec, ce->name, strlen(ce->name), 0, seen))
1122+
!match_pathspec(pathspec, ce->name, ce_namelen(ce), 0, seen))
11231123
filtered = 1;
11241124

11251125
if (ce_stage(ce)) {
@@ -1841,7 +1841,7 @@ int read_index_unmerged(struct index_state *istate)
18411841
if (!ce_stage(ce))
18421842
continue;
18431843
unmerged = 1;
1844-
len = strlen(ce->name);
1844+
len = ce_namelen(ce);
18451845
size = cache_entry_size(len);
18461846
new_ce = xcalloc(1, size);
18471847
memcpy(new_ce->name, ce->name, len);

unpack-trees.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1296,7 +1296,7 @@ static int verify_clean_subdirectory(struct cache_entry *ce,
12961296
* First let's make sure we do not have a local modification
12971297
* in that directory.
12981298
*/
1299-
namelen = strlen(ce->name);
1299+
namelen = ce_namelen(ce);
13001300
for (i = locate_in_src_index(ce, o);
13011301
i < o->src_index->cache_nr;
13021302
i++) {

0 commit comments

Comments
 (0)