MCPcopy Create free account
hub / github.com/VictorGordan/opengl-tutorials / LowerBound

Function LowerBound

ImGUI GLFW Tutorial/imgui/imgui.cpp:1873–1893  ·  view source on GitHub ↗

std::lower_bound but without the bullshit

Source from the content-addressed store, hash-verified

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

Callers 9

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

Calls

no outgoing calls

Tested by

no test coverage detected