MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/PositionBasedDynamics / LowerBound

Function LowerBound

extern/imgui/imgui.cpp:2290–2310  ·  view source on GitHub ↗

std::lower_bound but without the bullshit

Source from the content-addressed store, hash-verified

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