MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / LowerBound

Function LowerBound

lib/imgui/imgui.cpp:1812–1832  ·  view source on GitHub ↗

std::lower_bound but without the bullshit

Source from the content-addressed store, hash-verified

1810
1811// std::lower_bound but without the bullshit
1812static ImGuiStorage::ImGuiStoragePair* LowerBound(ImVector<ImGuiStorage::ImGuiStoragePair>& data, ImGuiID key)
1813{
1814 ImGuiStorage::ImGuiStoragePair* first = data.Data;
1815 ImGuiStorage::ImGuiStoragePair* last = data.Data + data.Size;
1816 size_t count = (size_t)(last - first);
1817 while (count > 0)
1818 {
1819 size_t count2 = count >> 1;
1820 ImGuiStorage::ImGuiStoragePair* mid = first + count2;
1821 if (mid->key < key)
1822 {
1823 first = ++mid;
1824 count -= count2 + 1;
1825 }
1826 else
1827 {
1828 count = count2;
1829 }
1830 }
1831 return first;
1832}
1833
1834// For quicker full rebuild of a storage (instead of an incremental one), you may add all your contents and then sort once.
1835void 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