diff options
Diffstat (limited to 'split-index.c')
-rw-r--r-- | split-index.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/split-index.c b/split-index.c index 968b780a06..35da553655 100644 --- a/split-index.c +++ b/split-index.c @@ -60,7 +60,7 @@ static void mark_base_index_entries(struct index_state *base) * To keep track of the shared entries between * istate->base->cache[] and istate->cache[], base entry * position is stored in each base entry. All positions start - * from 1 instead of 0, which is resrved to say "this is a new + * from 1 instead of 0, which is reserved to say "this is a new * entry". */ for (i = 0; i < base->cache_nr; i++) @@ -83,8 +83,7 @@ void move_cache_to_base_index(struct index_state *istate) si->base->timestamp = istate->timestamp; ALLOC_GROW(si->base->cache, istate->cache_nr, si->base->cache_alloc); si->base->cache_nr = istate->cache_nr; - memcpy(si->base->cache, istate->cache, - sizeof(*istate->cache) * istate->cache_nr); + COPY_ARRAY(si->base->cache, istate->cache, istate->cache_nr); mark_base_index_entries(si->base); for (i = 0; i < si->base->cache_nr; i++) si->base->cache[i]->ce_flags &= ~CE_UPDATE_IN_BASE; @@ -141,8 +140,7 @@ void merge_base_index(struct index_state *istate) istate->cache = NULL; istate->cache_alloc = 0; ALLOC_GROW(istate->cache, istate->cache_nr, istate->cache_alloc); - memcpy(istate->cache, si->base->cache, - sizeof(*istate->cache) * istate->cache_nr); + COPY_ARRAY(istate->cache, si->base->cache, istate->cache_nr); si->nr_deletions = 0; si->nr_replacements = 0; |