Merge branch 'sg/cocci-move-array'

Code clean-up.

* sg/cocci-move-array:
  Use MOVE_ARRAY
This commit is contained in:
Junio C Hamano
2018-02-13 13:39:13 -08:00
9 changed files with 19 additions and 27 deletions

View File

@ -1217,9 +1217,8 @@ int add_index_entry(struct index_state *istate, struct cache_entry *ce, int opti
/* Add it in.. */
istate->cache_nr++;
if (istate->cache_nr > pos + 1)
memmove(istate->cache + pos + 1,
istate->cache + pos,
(istate->cache_nr - pos - 1) * sizeof(ce));
MOVE_ARRAY(istate->cache + pos + 1, istate->cache + pos,
istate->cache_nr - pos - 1);
set_index_entry(istate, pos, ce);
istate->cache_changed |= CE_ENTRY_ADDED;
return 0;