Optimization for empty array