1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:28:11 +00:00

AK: Make binary_search signature more generic.

This commit is contained in:
asynts 2020-12-29 16:13:16 +01:00 committed by Andreas Kling
parent 35c4338625
commit 50d24e4f98
6 changed files with 63 additions and 53 deletions

View file

@ -181,10 +181,10 @@ void RangeAllocator::deallocate(Range range)
size_t nearby_index = 0;
auto* existing_range = binary_search(
m_available_ranges.span(), range, [](auto& a, auto& b) {
return a.base().get() - b.end().get();
},
&nearby_index);
m_available_ranges.span(),
range,
&nearby_index,
[](auto& a, auto& b) { return a.base().get() - b.end().get(); });
size_t inserted_index = 0;
if (existing_range) {