| 3861 | */ |
| 3862 | template <typename CmpLess, typename IterT, typename KeyT> |
| 3863 | static 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 | |
| 3882 | template<typename CmpLess, typename IterT, typename KeyT> |
| 3883 | IterT VmaBinaryFindSorted(const IterT& beg, const IterT& end, const KeyT& value, const CmpLess& cmp) |
no outgoing calls
no test coverage detected