optimizing arrays with array.length = 0