summaryrefslogtreecommitdiff
path: root/name-hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'name-hash.c')
-rw-r--r--name-hash.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/name-hash.c b/name-hash.c
index 45c98db0a0..163849831c 100644
--- a/name-hash.c
+++ b/name-hash.c
@@ -578,6 +578,8 @@ static void threaded_lazy_init_name_hash(
static void lazy_init_name_hash(struct index_state *istate)
{
+ uint64_t start = getnanotime();
+
if (istate->name_hash_initialized)
return;
hashmap_init(&istate->name_hash, cache_entry_cmp, NULL, istate->cache_nr);
@@ -600,6 +602,7 @@ static void lazy_init_name_hash(struct index_state *istate)
}
istate->name_hash_initialized = 1;
+ trace_performance_since(start, "initialize name hash");
}
/*
@@ -696,12 +699,12 @@ void adjust_dirname_case(struct index_state *istate, char *name)
if (*ptr == '/') {
struct dir_entry *dir;
- ptr++;
- dir = find_dir_entry(istate, name, ptr - name + 1);
+ dir = find_dir_entry(istate, name, ptr - name);
if (dir) {
memcpy((void *)startPtr, dir->name + (startPtr - name), ptr - startPtr);
- startPtr = ptr;
+ startPtr = ptr + 1;
}
+ ptr++;
}
}
}