| 390 | estimatedOutputRowSize_ = rowSize; |
| 391 | } |
| 392 | } |
| 393 | |
| 394 | TopNRowNumber::TopRows* TopNRowNumber::nextPartition() { |
| 395 | if (!table_) { |
| 396 | if (!currentPartition_) { |
| 397 | currentPartition_ = 0; |
| 398 | return singlePartition_.get(); |
| 399 | } |
| 400 | return nullptr; |
| 401 | } |
| 402 | |
| 403 | if (!currentPartition_) { |
| 404 | numPartitions_ = table_->listAllRows( |
| 405 | &partitionIt_, |
| 406 | partitions_.size(), |
| 407 | RowContainer::kUnlimited, |
| 408 | partitions_.data()); |
| 409 | if (numPartitions_ == 0) { |
| 410 | // No more partitions. |
| 411 | return nullptr; |
| 412 | } |
| 413 | |
| 414 | currentPartition_ = 0; |
| 415 | } else { |
| 416 | ++currentPartition_.value(); |
| 417 | if (currentPartition_ >= numPartitions_) { |
| 418 | currentPartition_.reset(); |
| 419 | return nextPartition(); |
| 420 | } |
| 421 | } |
| 422 | |
| 423 | return ¤tPartition(); |
| 424 | } |
| 425 |
no test coverage detected