MCPcopy Create free account
hub / github.com/clementgallet/libTAS / GetIntRef

Method GetIntRef

src/external/imgui/imgui.cpp:2470–2476  ·  view source on GitHub ↗

References are only valid until a new value is added to the storage. Calling a Set***() function or a Get***Ref() function invalidates the pointer.

Source from the content-addressed store, hash-verified

2468
2469// References are only valid until a new value is added to the storage. Calling a Set***() function or a Get***Ref() function invalidates the pointer.
2470int* ImGuiStorage::GetIntRef(ImGuiID key, int default_val)
2471{
2472 ImGuiStoragePair* it = LowerBound(Data, key);
2473 if (it == Data.end() || it->key != key)
2474 it = Data.insert(it, ImGuiStoragePair(key, default_val));
2475 return &it->val_i;
2476}
2477
2478bool* ImGuiStorage::GetBoolRef(ImGuiID key, bool default_val)
2479{

Callers 1

GetOrAddByKeyMethod · 0.80

Calls 4

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

Tested by

no test coverage detected