std::lower_bound but without the bullshit
| 2734 | |
| 2735 | // std::lower_bound but without the bullshit |
| 2736 | ImGuiStoragePair* ImLowerBound(ImGuiStoragePair* in_begin, ImGuiStoragePair* in_end, ImGuiID key) |
| 2737 | { |
| 2738 | ImGuiStoragePair* in_p = in_begin; |
| 2739 | for (size_t count = (size_t)(in_end - in_p); count > 0; ) |
| 2740 | { |
| 2741 | size_t count2 = count >> 1; |
| 2742 | ImGuiStoragePair* mid = in_p + count2; |
| 2743 | if (mid->key < key) |
| 2744 | { |
| 2745 | in_p = ++mid; |
| 2746 | count -= count2 + 1; |
| 2747 | } |
| 2748 | else |
| 2749 | { |
| 2750 | count = count2; |
| 2751 | } |
| 2752 | } |
| 2753 | return in_p; |
| 2754 | } |
| 2755 | |
| 2756 | IM_MSVC_RUNTIME_CHECKS_OFF |
| 2757 | static int IMGUI_CDECL PairComparerByID(const void* lhs, const void* rhs) |
no outgoing calls
no test coverage detected