MCPcopy Create free account
hub / github.com/comaps/comaps / Add

Function Add

tools/track_analyzing/track_analyzer/utils.cpp:38–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38void Add(Stats::NameToCountMapping const & addition, Stats::NameToCountMapping & base)
39{
40 set<storage::CountryId> userKeys = GetKeys(addition);
41 set<storage::CountryId> const userKeys2 = GetKeys(base);
42 userKeys.insert(userKeys2.cbegin(), userKeys2.cend());
43
44 for (auto const & c : userKeys)
45 {
46 if (addition.count(c) == 0)
47 continue;
48
49 if (base.count(c) == 0)
50 {
51 base[c] = addition.at(c);
52 continue;
53 }
54
55 base[c] += addition.at(c);
56 }
57}
58
59void PrintMap(string const & keyName, string const & descr, Stats::NameToCountMapping const & mapping,
60 ostringstream & ss)

Callers 1

AddMethod · 0.70

Calls 6

GetKeysFunction · 0.85
atMethod · 0.80
insertMethod · 0.45
cbeginMethod · 0.45
cendMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected