Avoid initializing a local variable to an empty array before adding items to that array