Skip to content
  • René Scharfe's avatar
    use MOVE_ARRAY · f331ab9d
    René Scharfe authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Simplify the code for moving members inside of an array and make it more
    robust by using the helper macro MOVE_ARRAY.  It calculates the size
    based on the specified number of elements for us and supports NULL
    pointers when that number is zero.  Raw memmove(3) calls with NULL can
    cause the compiler to (over-eagerly) optimize out later NULL checks.
    
    This patch was generated with contrib/coccinelle/array.cocci and spatch
    (Coccinelle).
    
    Signed-off-by: default avatarRene Scharfe <l.s.r@web.de>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    f331ab9d