std::lower_bound but without the bullshit
| 2905 | |
| 2906 | // std::lower_bound but without the bullshit |
| 2907 | ImGuiStoragePair* ImLowerBound(ImGuiStoragePair* in_begin, ImGuiStoragePair* in_end, ImGuiID key) |
| 2908 | { |
| 2909 | ImGuiStoragePair* in_p = in_begin; |
| 2910 | for (size_t count = (size_t)(in_end - in_p); count > 0; ) |
| 2911 | { |
| 2912 | size_t count2 = count >> 1; |
| 2913 | ImGuiStoragePair* mid = in_p + count2; |
| 2914 | if (mid->key < key) |
| 2915 | { |
| 2916 | in_p = ++mid; |
| 2917 | count -= count2 + 1; |
| 2918 | } |
| 2919 | else |
| 2920 | { |
| 2921 | count = count2; |
| 2922 | } |
| 2923 | } |
| 2924 | return in_p; |
| 2925 | } |
| 2926 | |
| 2927 | IM_MSVC_RUNTIME_CHECKS_OFF |
| 2928 | static int IMGUI_CDECL PairComparerByID(const void* lhs, const void* rhs) |
no outgoing calls
no test coverage detected