Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
jinchengchenghh committed Sep 2, 2024
1 parent cf4f27f commit ce8d5b4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions velox/exec/SortBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,11 @@ void SortBuffer::spillOutput() {
void SortBuffer::prepareOutput(vector_size_t maxOutputRows) {
VELOX_CHECK_GT(maxOutputRows, 0);
VELOX_CHECK_GT(numInputRows_, numOutputRows_);
const uint64_t batchSizeMaybe = numInputRows_ - numOutputRows_;
const vector_size_t batchSize =
batchSizeMaybe > std::numeric_limits<vector_size_t>::max()
? maxOutputRows
: std::min<vector_size_t>(batchSizeMaybe, maxOutputRows);
const uint64_t batchSize = std::min<vector_size_t>(
std::min<uint64_t>(
numInputRows_ - numOutputRows_,
std::numeric_limits<vector_size_t>::max()),
maxOutputRows);
if (output_ != nullptr) {
VectorPtr output = std::move(output_);
BaseVector::prepareForReuse(output, batchSize);
Expand Down

0 comments on commit ce8d5b4

Please sign in to comment.