MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / VmaBinaryFindFirstNotLess

Function VmaBinaryFindFirstNotLess

include/vk_mem_alloc.h:3863–3880  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3861*/
3862template <typename CmpLess, typename IterT, typename KeyT>
3863static IterT VmaBinaryFindFirstNotLess(IterT beg, IterT end, const KeyT& key, const CmpLess& cmp)
3864{
3865 size_t down = 0;
3866 size_t up = size_t(end - beg);
3867 while (down < up)
3868 {
3869 const size_t mid = down + (up - down) / 2; // Overflow-safe midpoint calculation
3870 if (cmp(*(beg + mid), key))
3871 {
3872 down = mid + 1;
3873 }
3874 else
3875 {
3876 up = mid;
3877 }
3878 }
3879 return beg + down;
3880}
3881
3882template<typename CmpLess, typename IterT, typename KeyT>
3883IterT VmaBinaryFindSorted(const IterT& beg, const IterT& end, const KeyT& value, const CmpLess& cmp)

Callers 2

VmaVectorInsertSortedFunction · 0.85
VmaVectorRemoveSortedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected