MCPcopy Create free account
hub / github.com/AlexandreRouma/SDRPlusPlus / LowerBound

Function LowerBound

core/src/imgui/imgui.cpp:1876–1896  ·  view source on GitHub ↗

std::lower_bound but without the bullshit

Source from the content-addressed store, hash-verified

1874
1875// std::lower_bound but without the bullshit
1876static ImGuiStorage::ImGuiStoragePair* LowerBound(ImVector<ImGuiStorage::ImGuiStoragePair>& data, ImGuiID key)
1877{
1878 ImGuiStorage::ImGuiStoragePair* first = data.Data;
1879 ImGuiStorage::ImGuiStoragePair* last = data.Data + data.Size;
1880 size_t count = (size_t)(last - first);
1881 while (count > 0)
1882 {
1883 size_t count2 = count >> 1;
1884 ImGuiStorage::ImGuiStoragePair* mid = first + count2;
1885 if (mid->key < key)
1886 {
1887 first = ++mid;
1888 count -= count2 + 1;
1889 }
1890 else
1891 {
1892 count = count2;
1893 }
1894 }
1895 return first;
1896}
1897
1898// For quicker full rebuild of a storage (instead of an incremental one), you may add all your contents and then sort once.
1899void 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