mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 08:08:43 +00:00
AK: Fix the signature of binary_search.
This commit is contained in:
parent
18b3de7555
commit
8e08d9f70a
Notes:
sideshowbarker
2024-07-19 03:07:11 +09:00
Author: https://github.com/asynts
Commit: 8e08d9f70a
Pull-request: https://github.com/SerenityOS/serenity/pull/3309
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/stelar7
2 changed files with 6 additions and 6 deletions
|
@ -33,13 +33,13 @@
|
|||
namespace AK {
|
||||
|
||||
template<typename T>
|
||||
int integral_compare(const T& a, const T& b)
|
||||
int integral_compare(const typename RemoveConst<T>::Type& a, const typename RemoveConst<T>::Type& b)
|
||||
{
|
||||
return a - b;
|
||||
}
|
||||
|
||||
template<typename T, typename Compare>
|
||||
T* binary_search(Span<T> haystack, const T& needle, Compare compare = integral_compare, size_t* nearby_index = nullptr)
|
||||
T* binary_search(Span<T> haystack, const typename RemoveConst<T>::Type& needle, Compare compare = integral_compare, size_t* nearby_index = nullptr)
|
||||
{
|
||||
if (haystack.size() == 0) {
|
||||
if (nearby_index)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue