diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-02-13 22:39:13 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-02-13 22:39:13 +0100 |
commit | cbf0240f82fc6b7072c7d18fa56caace4902a44b (patch) | |
tree | 5bf09c102c34b2984b2a09ac658afd673e876fd3 /read-cache.c | |
parent | Merge branch 'tg/split-index-fixes' (diff) | |
parent | Use MOVE_ARRAY (diff) | |
download | git-cbf0240f82fc6b7072c7d18fa56caace4902a44b.tar.xz git-cbf0240f82fc6b7072c7d18fa56caace4902a44b.zip |
Merge branch 'sg/cocci-move-array'
Code clean-up.
* sg/cocci-move-array:
Use MOVE_ARRAY
Diffstat (limited to 'read-cache.c')
-rw-r--r-- | read-cache.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/read-cache.c b/read-cache.c index d13ce83794..9e0aeffe11 100644 --- a/read-cache.c +++ b/read-cache.c @@ -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; |