MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / SetInt

Method SetInt

plugins/Cardinal/src/DearImGui/imgui.cpp:2024–2033  ·  view source on GitHub ↗

FIXME-OPT: Need a way to reuse the result of lower_bound when doing GetInt()/SetInt() - not too bad because it only happens on explicit interaction (maximum one a frame)

Source from the content-addressed store, hash-verified

2022
2023// FIXME-OPT: Need a way to reuse the result of lower_bound when doing GetInt()/SetInt() - not too bad because it only happens on explicit interaction (maximum one a frame)
2024void ImGuiStorage::SetInt(ImGuiID key, int val)
2025{
2026 ImGuiStoragePair* it = LowerBound(Data, key);
2027 if (it == Data.end() || it->key != key)
2028 {
2029 Data.insert(it, ImGuiStoragePair(key, val));
2030 return;
2031 }
2032 it->val_i = val;
2033}
2034
2035void ImGuiStorage::SetBool(ImGuiID key, bool val)
2036{

Callers 3

TreeNodeBehaviorMethod · 0.80
RemoveFunction · 0.80

Calls 4

LowerBoundFunction · 0.85
ImGuiStoragePairClass · 0.85
insertMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected