Merge branch 'rs/move-array'

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
This commit is contained in:
Junio C Hamano
2017-08-11 13:26:57 -07:00
12 changed files with 47 additions and 34 deletions

View File

@ -223,9 +223,8 @@ int unregister_shallow(const struct object_id *oid)
if (pos < 0)
return -1;
if (pos + 1 < commit_graft_nr)
memmove(commit_graft + pos, commit_graft + pos + 1,
sizeof(struct commit_graft *)
* (commit_graft_nr - pos - 1));
MOVE_ARRAY(commit_graft + pos, commit_graft + pos + 1,
commit_graft_nr - pos - 1);
commit_graft_nr--;
return 0;
}