MCPcopy Create free account
hub / github.com/ShenCiao/CialloResearch / LowerBound

Function LowerBound

imgui/imgui.cpp:2294–2314  ·  view source on GitHub ↗

std::lower_bound but without the bullshit

Source from the content-addressed store, hash-verified

2292
2293// std::lower_bound but without the bullshit
2294static ImGuiStorage::ImGuiStoragePair* LowerBound(ImVector<ImGuiStorage::ImGuiStoragePair>& data, ImGuiID key)
2295{
2296 ImGuiStorage::ImGuiStoragePair* first = data.Data;
2297 ImGuiStorage::ImGuiStoragePair* last = data.Data + data.Size;
2298 size_t count = (size_t)(last - first);
2299 while (count > 0)
2300 {
2301 size_t count2 = count >> 1;
2302 ImGuiStorage::ImGuiStoragePair* mid = first + count2;
2303 if (mid->key < key)
2304 {
2305 first = ++mid;
2306 count -= count2 + 1;
2307 }
2308 else
2309 {
2310 count = count2;
2311 }
2312 }
2313 return first;
2314}
2315
2316// For quicker full rebuild of a storage (instead of an incremental one), you may add all your contents and then sort once.
2317void 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