diff options
| author | Junio C Hamano <gitster@pobox.com> | 2018-02-13 13:39:13 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2018-02-13 13:39:13 -0800 |
| commit | cbf0240f82fc6b7072c7d18fa56caace4902a44b (patch) | |
| tree | 5bf09c102c34b2984b2a09ac658afd673e876fd3 /replace_object.c | |
| parent | Merge branch 'tg/split-index-fixes' (diff) | |
| parent | Use MOVE_ARRAY (diff) | |
| download | git-cbf0240f82fc6b7072c7d18fa56caace4902a44b.tar.gz git-cbf0240f82fc6b7072c7d18fa56caace4902a44b.zip | |
Merge branch 'sg/cocci-move-array'
Code clean-up.
* sg/cocci-move-array:
Use MOVE_ARRAY
Diffstat (limited to 'replace_object.c')
| -rw-r--r-- | replace_object.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/replace_object.c b/replace_object.c index f0b39f06d5..3e49965d05 100644 --- a/replace_object.c +++ b/replace_object.c @@ -44,10 +44,8 @@ static int register_replace_object(struct replace_object *replace, ALLOC_GROW(replace_object, replace_object_nr + 1, replace_object_alloc); replace_object_nr++; if (pos < replace_object_nr) - memmove(replace_object + pos + 1, - replace_object + pos, - (replace_object_nr - pos - 1) * - sizeof(*replace_object)); + MOVE_ARRAY(replace_object + pos + 1, replace_object + pos, + replace_object_nr - pos - 1); replace_object[pos] = replace; return 0; } |
