diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-02-13 22:39:13 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-02-13 22:39:13 +0100 |
commit | cbf0240f82fc6b7072c7d18fa56caace4902a44b (patch) | |
tree | 5bf09c102c34b2984b2a09ac658afd673e876fd3 /refs | |
parent | Merge branch 'tg/split-index-fixes' (diff) | |
parent | Use MOVE_ARRAY (diff) | |
download | git-cbf0240f82fc6b7072c7d18fa56caace4902a44b.tar.xz git-cbf0240f82fc6b7072c7d18fa56caace4902a44b.zip |
Merge branch 'sg/cocci-move-array'
Code clean-up.
* sg/cocci-move-array:
Use MOVE_ARRAY
Diffstat (limited to 'refs')
-rw-r--r-- | refs/ref-cache.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/refs/ref-cache.c b/refs/ref-cache.c index 82c1cf90a7..e90bd3e727 100644 --- a/refs/ref-cache.c +++ b/refs/ref-cache.c @@ -238,10 +238,8 @@ int remove_entry_from_dir(struct ref_dir *dir, const char *refname) return -1; entry = dir->entries[entry_index]; - memmove(&dir->entries[entry_index], - &dir->entries[entry_index + 1], - (dir->nr - entry_index - 1) * sizeof(*dir->entries) - ); + MOVE_ARRAY(&dir->entries[entry_index], + &dir->entries[entry_index + 1], dir->nr - entry_index - 1); dir->nr--; if (dir->sorted > entry_index) dir->sorted--; |