Skip to content

Commit

Permalink
Revert to C++17
Browse files Browse the repository at this point in the history
  • Loading branch information
alexowens90 committed May 9, 2024
1 parent b256370 commit 2e67393
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
15 changes: 11 additions & 4 deletions cpp/arcticdb/async/tasks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,13 +406,20 @@ struct MemSegmentProcessingTask : BaseTask {
ARCTICDB_MOVE_ONLY_DEFAULT(MemSegmentProcessingTask)

Composite<EntityIds> operator()() {
std::ranges::reverse_view reversed_clauses{clauses_};
for (const auto& clause: reversed_clauses) {
entity_ids_ = clause->process(std::move(entity_ids_));
// TODO: Replace with commented out code once C++20 is reinstated
for (auto clause = clauses_.crbegin(); clause != clauses_.crend(); ++clause) {
entity_ids_ = (*clause)->process(std::move(entity_ids_));

if(clause->clause_info().requires_repartition_)
if((*clause)->clause_info().requires_repartition_)
break;
}
// std::ranges::reverse_view reversed_clauses{clauses_};
// for (const auto& clause: reversed_clauses) {
// entity_ids_ = clause->process(std::move(entity_ids_));
//
// if(clause->clause_info().requires_repartition_)
// break;
// }
return std::move(entity_ids_);
}

Expand Down
11 changes: 9 additions & 2 deletions cpp/arcticdb/processing/clause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,12 +616,19 @@ std::vector<std::vector<size_t>> ResampleClause<closed_boundary>::structure_for_
}
debug::check<ErrorCode::E_ASSERTION_FAILURE>(std::is_sorted(bucket_boundaries_.begin(), bucket_boundaries_.end()),
"Resampling expects provided bucket boundaries to be strictly monotonically increasing");
std::erase_if(ranges_and_keys, [this](const RangesAndKey &ranges_and_key) {
// TODO: Replace with commented out code once C++20 is reinstated
ranges_and_keys.erase(std::remove_if(ranges_and_keys.begin(), ranges_and_keys.end(), [this](const RangesAndKey &ranges_and_key) {
auto [start_index, end_index] = ranges_and_key.key_.time_range();
// end_index from the key is 1 nanosecond larger than the index value of the last row in the row-slice
end_index--;
return index_range_outside_bucket_range(start_index, end_index);
});
}), ranges_and_keys.end());
// std::erase_if(ranges_and_keys, [this](const RangesAndKey &ranges_and_key) {
// auto [start_index, end_index] = ranges_and_key.key_.time_range();
// // end_index from the key is 1 nanosecond larger than the index value of the last row in the row-slice
// end_index--;
// return index_range_outside_bucket_range(start_index, end_index);
// });
auto res = structure_by_row_slice(ranges_and_keys, 0);
// Element i of res also needs the values from element i+1 if there is a bucket which incorporates the last index
// value of row-slice i and the first value of row-slice i+1
Expand Down

0 comments on commit 2e67393

Please sign in to comment.