Looks good, but I don't think the second one is necessary: As I said, if you make an array grow, new elements are guaranteed initialized, so are already 0. The first part looks correct.