MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / LowerBound

Function LowerBound

KBotExt/imgui/imgui.cpp:2352–2372  ·  view source on GitHub ↗

std::lower_bound but without the bullshit

Source from the content-addressed store, hash-verified

2350
2351// std::lower_bound but without the bullshit
2352static ImGuiStorage::ImGuiStoragePair* LowerBound(ImVector<ImGuiStorage::ImGuiStoragePair>& data, ImGuiID key)
2353{
2354 ImGuiStorage::ImGuiStoragePair* first = data.Data;
2355 ImGuiStorage::ImGuiStoragePair* last = data.Data + data.Size;
2356 size_t count = (size_t)(last - first);
2357 while (count > 0)
2358 {
2359 size_t count2 = count >> 1;
2360 ImGuiStorage::ImGuiStoragePair* mid = first + count2;
2361 if (mid->key < key)
2362 {
2363 first = ++mid;
2364 count -= count2 + 1;
2365 }
2366 else
2367 {
2368 count = count2;
2369 }
2370 }
2371 return first;
2372}
2373
2374// For quicker full rebuild of a storage (instead of an incremental one), you may add all your contents and then sort once.
2375void ImGuiStorage::BuildSortByKey()

Callers 9

GetIntMethod · 0.85
GetFloatMethod · 0.85
GetVoidPtrMethod · 0.85
GetIntRefMethod · 0.85
GetFloatRefMethod · 0.85
GetVoidPtrRefMethod · 0.85
SetIntMethod · 0.85
SetFloatMethod · 0.85
SetVoidPtrMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected