Skip to content

Commit

Permalink
Simplify BlockZipperJoinImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinTF committed Oct 16, 2024
1 parent b8db05a commit f54d287
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/util/JoinAlgorithms/JoinAlgorithms.h
Original file line number Diff line number Diff line change
Expand Up @@ -751,10 +751,6 @@ struct BlockZipperJoinImpl {
using ProjectedEl = LeftSide::ProjectedEl;
static_assert(std::same_as<ProjectedEl, typename RightSide::ProjectedEl>);

// The largest element for which all blocks are currently stored in the buffer
// and processed.
std::optional<ProjectedEl> currentMinEl_ = std::nullopt;

// Create an equality comparison from the `lessThan` predicate.
bool eq(const auto& el1, const auto& el2) {
return !lessThan_(el1, el2) && !lessThan_(el2, el1);
Expand Down Expand Up @@ -980,9 +976,7 @@ struct BlockZipperJoinImpl {
}

// Add the remaining blocks such that condition 3 from above is fulfilled.
auto blockStatus = fillEqualToCurrentElBothSides(getCurrentEl());
currentMinEl_ = getCurrentEl();
return blockStatus;
return fillEqualToCurrentElBothSides(getCurrentEl());
}

// Combine the above functionality and perform one round of joining.
Expand All @@ -991,11 +985,10 @@ struct BlockZipperJoinImpl {
void joinBuffers(BlockStatus& blockStatus) {
auto& currentBlocksLeft = leftSide_.currentBlocks_;
auto& currentBlocksRight = rightSide_.currentBlocks_;
ProjectedEl currentEl = getCurrentEl();
joinAndRemoveLessThanCurrentEl<DoOptionalJoin>(
currentBlocksLeft, currentBlocksRight, getCurrentEl());
currentBlocksLeft, currentBlocksRight, currentEl);

// TODO<joka921> This should still be the same.
ProjectedEl currentEl = getCurrentEl();
// At this point the `currentBlocksLeft/Right` only consist of elements `>=
// currentEl`. We now obtain a view on the elements `== currentEl` which are
// needed for the next step (the Cartesian product). In the last block,
Expand Down

0 comments on commit f54d287

Please sign in to comment.