summaryrefslogtreecommitdiffstats
path: root/read-cache.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-08-23 23:33:46 +0200
committerJunio C Hamano <gitster@pobox.com>2017-08-23 23:33:46 +0200
commitd3b7ee087e3ed409b943d62501bd7fb8dbd96dd8 (patch)
tree1ed0f2f407610d50b984a4fa9b95bb72eaa17c14 /read-cache.c
parentMerge branch 'rs/bswap-ubsan-fix' into maint (diff)
parentls-files: don't try to prune an empty index (diff)
downloadgit-d3b7ee087e3ed409b943d62501bd7fb8dbd96dd8.tar.xz
git-d3b7ee087e3ed409b943d62501bd7fb8dbd96dd8.zip
Merge branch 'rs/move-array' into maint
Code clean-up. * rs/move-array: ls-files: don't try to prune an empty index apply: use COPY_ARRAY and MOVE_ARRAY in update_image() use MOVE_ARRAY add MOVE_ARRAY
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/read-cache.c b/read-cache.c
index 2121b6e7bb..acfb028f48 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -515,9 +515,8 @@ int remove_index_entry_at(struct index_state *istate, int pos)
istate->cache_nr--;
if (pos >= istate->cache_nr)
return 0;
- memmove(istate->cache + pos,
- istate->cache + pos + 1,
- (istate->cache_nr - pos) * sizeof(struct cache_entry *));
+ MOVE_ARRAY(istate->cache + pos, istate->cache + pos + 1,
+ istate->cache_nr - pos);
return 1;
}