From 351846bb6112947ea93aee0e7eeaecdb017c5791 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Botond=20D=C3=A9nes?= Date: Wed, 20 Nov 2024 04:26:40 -0500 Subject: [PATCH] readers/multishard: migrate to std::ranges::{push,pop}_heap() std::ranges::{push,pop}_heap() will only generate default comparator if the compared types are fully ordered. So we need to pass std::less<> explicitely as comparator for the code to compile. --- readers/multishard.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/readers/multishard.cc b/readers/multishard.cc index 3107146cd7..8fd1430f67 100644 --- a/readers/multishard.cc +++ b/readers/multishard.cc @@ -7,7 +7,6 @@ */ #include "utils/assert.hh" -#include #include #include #include @@ -1065,7 +1064,7 @@ void multishard_combining_reader_v2::on_partition_range_change(const dht::partit // We stop earlier if the sharder has no ranges for the remaining shards. for (next = sharder.next(*_schema); next && next->shard != _current_shard; next = sharder.next(*_schema)) { _shard_selection_min_heap.push_back(shard_and_token{next->shard, next->ring_range.start()->value().token()}); - boost::push_heap(_shard_selection_min_heap); + std::ranges::push_heap(_shard_selection_min_heap, std::less{}); } } @@ -1074,13 +1073,13 @@ bool multishard_combining_reader_v2::maybe_move_to_next_shard(const dht::token* return false; } - boost::pop_heap(_shard_selection_min_heap); + std::ranges::pop_heap(_shard_selection_min_heap, std::less{}); const auto next_shard = _shard_selection_min_heap.back().shard; _shard_selection_min_heap.pop_back(); if (t) { _shard_selection_min_heap.push_back(shard_and_token{_current_shard, *t}); - boost::push_heap(_shard_selection_min_heap); + std::ranges::push_heap(_shard_selection_min_heap, std::less{}); } _crossed_shards = true; @@ -1114,7 +1113,7 @@ future<> multishard_combining_reader_v2::handle_empty_reader_buffer() { // background. They will be brought to the foreground when we move // to their respective shard. for (unsigned i = 1; i < _concurrency && !shard_selection_min_heap_copy.empty(); ++i) { - boost::pop_heap(shard_selection_min_heap_copy); + std::ranges::pop_heap(shard_selection_min_heap_copy, std::less{}); const auto next_shard = shard_selection_min_heap_copy.back().shard; shard_selection_min_heap_copy.pop_back(); _shard_readers[next_shard]->read_ahead();