mirror of
https://github.com/git/git.git
synced 2025-04-18 08:04:47 +00:00
Merge branch 'tg/ce-namelen'
Trivially correct clean-up and micro optimization. * tg/ce-namelen: Replace strlen() with ce_namelen()
This commit is contained in:
commit
4495f88cd8
@ -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);
|
||||
|
@ -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++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user