mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-10 04:50:31 -04:00
chore(block_cache): cannot easily use std::ranges
heap operations
This commit is contained in:
parent
ab8f67619f
commit
e252182171
@ -179,6 +179,7 @@ class block_request_set {
|
|||||||
}
|
}
|
||||||
|
|
||||||
queue_.emplace_back(begin, end, std::move(promise));
|
queue_.emplace_back(begin, end, std::move(promise));
|
||||||
|
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||||
std::push_heap(queue_.begin(), queue_.end());
|
std::push_heap(queue_.begin(), queue_.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,11 +187,13 @@ class block_request_set {
|
|||||||
queue_.reserve(queue_.size() + other.queue_.size());
|
queue_.reserve(queue_.size() + other.queue_.size());
|
||||||
std::ranges::move(other.queue_, std::back_inserter(queue_));
|
std::ranges::move(other.queue_, std::back_inserter(queue_));
|
||||||
other.queue_.clear();
|
other.queue_.clear();
|
||||||
|
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||||
std::make_heap(queue_.begin(), queue_.end());
|
std::make_heap(queue_.begin(), queue_.end());
|
||||||
range_end_ = std::max(range_end_, other.range_end_);
|
range_end_ = std::max(range_end_, other.range_end_);
|
||||||
}
|
}
|
||||||
|
|
||||||
block_request get() {
|
block_request get() {
|
||||||
|
// NOLINTNEXTLINE(modernize-use-ranges)
|
||||||
std::pop_heap(queue_.begin(), queue_.end());
|
std::pop_heap(queue_.begin(), queue_.end());
|
||||||
block_request tmp = std::move(queue_.back());
|
block_request tmp = std::move(queue_.back());
|
||||||
queue_.pop_back();
|
queue_.pop_back();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user