mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 10:22:05 -05:00
d7177212fd
binary_search takes a haystack, a size, a needle and a compare function. The compare function should return negative if a < b, positive if a > b and 0 if a == b. The "sane default" compare function is integral_compare which implements this with subtraction a - b. binary_search returns a pointer to a matching element, NOT necessarily the FIRST matching element. It returns a nullptr if the element was not found. This patch includes tests for binary_search. |
||
---|---|---|
.. | ||
4chan_catalog.json | ||
Makefile | ||
TestAtomic.cpp | ||
TestBinarySearch.cpp | ||
TestCircularQueue.cpp | ||
TestFileSystemPath.cpp | ||
TestFixedArray.cpp | ||
TestHashMap.cpp | ||
TestJSON.cpp | ||
TestNonnullRefPtr.cpp | ||
TestOptional.cpp | ||
TestQueue.cpp | ||
TestRefPtr.cpp | ||
TestString.cpp | ||
TestStringView.cpp | ||
TestURL.cpp | ||
TestUtf8.cpp | ||
TestVector.cpp | ||
TestWeakPtr.cpp |