Skip to content

Commit 21b3913

Browse files
committed
remove some branches
1 parent 3d897ac commit 21b3913

File tree

4 files changed

+1
-17
lines changed

4 files changed

+1
-17
lines changed

src/Interpreters/GraceHashJoin.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,11 @@ namespace
6464
if (!block)
6565
{
6666
eof = true;
67-
if (blocks.size() == 1)
68-
return blocks.front();
6967
return concatenateBlocks(blocks);
7068
}
7169
blocks.push_back(std::move(block));
7270
} while (rows_read < result_block_size);
7371

74-
if (blocks.size() == 1)
75-
return blocks.front();
7672
return concatenateBlocks(blocks);
7773
}
7874

@@ -743,10 +739,7 @@ void GraceHashJoin::addBlockToJoinImpl(Block block)
743739
current_blocks.emplace_back(std::move(blocks[bucket_index]));
744740
}
745741

746-
if (current_blocks.size() == 1)
747-
current_block = std::move(current_blocks.front());
748-
else
749-
current_block = concatenateBlocks(current_blocks);
742+
current_block = concatenateBlocks(current_blocks);
750743
}
751744

752745
hash_join = makeInMemoryJoin(fmt::format("grace{}", bucket_index), prev_keys_num);

src/Interpreters/SortedBlocksWriter.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,6 @@ Block SortedBlocksBuffer::mergeBlocks(Blocks && blocks) const
389389
blocks.swap(tmp_blocks);
390390
}
391391

392-
if (blocks.size() == 1)
393-
return blocks[0];
394-
395392
return concatenateBlocks(blocks);
396393
}
397394

src/TableFunctions/TableFunctionExplain.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,6 @@ Block executeMonoBlock(QueryPipeline & pipeline)
167167
break;
168168
}
169169

170-
if (blocks.size() == 1)
171-
return blocks[0];
172-
173170
return concatenateBlocks(blocks);
174171
}
175172

src/TableFunctions/TableFunctionFormat.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,6 @@ Block TableFunctionFormat::parseData(const ColumnsDescription & columns, const S
125125
while (reader->pull(block))
126126
blocks.push_back(std::move(block));
127127

128-
if (blocks.size() == 1)
129-
return blocks[0];
130-
131128
/// In case when data contains more then 1 block we combine
132129
/// them all to one big block (this is considered a rare case).
133130
return concatenateBlocks(blocks);

0 commit comments

Comments
 (0)