summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-02-13 13:39:13 -0800
committerJunio C Hamano <gitster@pobox.com>2018-02-13 13:39:13 -0800
commitcbf0240f82fc6b7072c7d18fa56caace4902a44b (patch)
tree5bf09c102c34b2984b2a09ac658afd673e876fd3 /commit.c
parente75c862125f219c983cd2980d1b33ec09a3c34b9 (diff)
parentf919ffebed3c570bf3c2a5f36444527ea5df42de (diff)
downloadgit-cbf0240f82fc6b7072c7d18fa56caace4902a44b.tar.gz
Merge branch 'sg/cocci-move-array'
Code clean-up. * sg/cocci-move-array: Use MOVE_ARRAY
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/commit.c b/commit.c
index ff51c9f34a..c948c8b0e4 100644
--- a/commit.c
+++ b/commit.c
@@ -126,10 +126,8 @@ int register_commit_graft(struct commit_graft *graft, int ignore_dups)
ALLOC_GROW(commit_graft, commit_graft_nr + 1, commit_graft_alloc);
commit_graft_nr++;
if (pos < commit_graft_nr)
- memmove(commit_graft + pos + 1,
- commit_graft + pos,
- (commit_graft_nr - pos - 1) *
- sizeof(*commit_graft));
+ MOVE_ARRAY(commit_graft + pos + 1, commit_graft + pos,
+ commit_graft_nr - pos - 1);
commit_graft[pos] = graft;
return 0;
}