Skip to content

Commit

Permalink
fix clang tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
SeaRise committed Apr 20, 2023
1 parent 3d49d23 commit 7b0b566
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 19 deletions.
29 changes: 12 additions & 17 deletions dbms/src/Operators/LocalAggregateRestorer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,6 @@ LocalAggregateRestorer::LocalAggregateRestorer(
assert(!bucket_inputs.empty());
}

bool LocalAggregateRestorer::loadFromInputs()
{
assert(!bucket_inputs.empty());
for (auto & bucket_input : bucket_inputs)
{
if unlikely (is_cancelled())
return false;
if (bucket_input.needLoad())
bucket_input.load();
}
if unlikely (is_cancelled())
return false;
return true;
}

void LocalAggregateRestorer::storeToBucketData()
{
assert(!finished);
Expand Down Expand Up @@ -80,9 +65,19 @@ void LocalAggregateRestorer::loadBucketData()
if unlikely (finished || is_cancelled())
return;

// load bucket data from inputs.
assert(bucket_data.empty());
if (loadFromInputs())
storeToBucketData();
for (auto & bucket_input : bucket_inputs)
{
if unlikely (is_cancelled())
return;
if (bucket_input.needLoad())
bucket_input.load();
}
if unlikely (is_cancelled())
return;

storeToBucketData();
}

bool LocalAggregateRestorer::tryPop(Block & block)
Expand Down
2 changes: 0 additions & 2 deletions dbms/src/Operators/LocalAggregateRestorer.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ class LocalAggregateRestorer
bool tryPop(Block & block);

private:
bool loadFromInputs();

void storeToBucketData();

private:
Expand Down

0 comments on commit 7b0b566

Please sign in to comment.