optimized array reset