Small optimization to array check