| 3586 | */ |
| 3587 | template <typename CmpLess, typename IterT, typename KeyT> |
| 3588 | static IterT VmaBinaryFindFirstNotLess(IterT beg, IterT end, const KeyT& key, const CmpLess& cmp) |
| 3589 | { |
| 3590 | size_t down = 0, up = size_t(end - beg); |
| 3591 | while (down < up) |
| 3592 | { |
| 3593 | const size_t mid = down + (up - down) / 2; // Overflow-safe midpoint calculation |
| 3594 | if (cmp(*(beg + mid), key)) |
| 3595 | { |
| 3596 | down = mid + 1; |
| 3597 | } |
| 3598 | else |
| 3599 | { |
| 3600 | up = mid; |
| 3601 | } |
| 3602 | } |
| 3603 | return beg + down; |
| 3604 | } |
| 3605 | |
| 3606 | template<typename CmpLess, typename IterT, typename KeyT> |
| 3607 | IterT VmaBinaryFindSorted(const IterT& beg, const IterT& end, const KeyT& value, const CmpLess& cmp) |
no outgoing calls
no test coverage detected