diff options
| author | Junio C Hamano <gitster@pobox.com> | 2017-08-23 14:33:46 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2017-08-23 14:33:46 -0700 |
| commit | d3b7ee087e3ed409b943d62501bd7fb8dbd96dd8 (patch) | |
| tree | 1ed0f2f407610d50b984a4fa9b95bb72eaa17c14 /cache-tree.c | |
| parent | 752732c6d802ebc01a26e59614da38f900e3b89e (diff) | |
| parent | 168e63554cbd965fee4d0092e02f8170eba7481f (diff) | |
| download | git-d3b7ee087e3ed409b943d62501bd7fb8dbd96dd8.tar.gz | |
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 'cache-tree.c')
| -rw-r--r-- | cache-tree.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/cache-tree.c b/cache-tree.c index ec23d8c03d..2440d1dc89 100644 --- a/cache-tree.c +++ b/cache-tree.c @@ -131,9 +131,8 @@ static int do_invalidate_path(struct cache_tree *it, const char *path) * move 4 and 5 up one place (2 entries) * 2 = 6 - 3 - 1 = subtree_nr - pos - 1 */ - memmove(it->down+pos, it->down+pos+1, - sizeof(struct cache_tree_sub *) * - (it->subtree_nr - pos - 1)); + MOVE_ARRAY(it->down + pos, it->down + pos + 1, + it->subtree_nr - pos - 1); it->subtree_nr--; } return 1; |
