MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / findOrCreate

Method findOrCreate

Telegram/SourceFiles/data/data_histories.cpp:150–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150not_null<History*> Histories::findOrCreate(PeerId peerId) {
151 Expects(peerId != 0);
152
153 if (const auto result = find(peerId)) {
154 return result;
155 }
156 const auto &[i, ok] = _map.emplace(
157 peerId,
158 std::make_unique<History>(&owner(), peerId));
159 return i->second.get();
160}
161
162void Histories::unloadAll() {
163 for (const auto &[peerId, history] : _map) {

Callers 1

historyMethod · 0.80

Calls 2

emplaceMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected