operator[] default-constructs the map value if no value exists
for that key. Default-construction of int yields a zero. So all
the manual faffing around is just unnecessary.
Этот коммит содержится в:
Chris Kitching
2017-10-25 19:42:46 +01:00
родитель 00bb447e55
Коммит d8beee8918
+3 -12
Просмотреть файл
@@ -181,18 +181,9 @@ protected:
map = cuda2hipUnconverted;
mapTotal = cuda2hipUnconvertedTotal;
}
auto found = map.find(cudaName);
if (found == map.end()) {
map.insert(std::pair<std::string, uint64_t>(cudaName, 1));
} else {
found->second++;
}
auto foundT = mapTotal.find(cudaName);
if (foundT == mapTotal.end()) {
mapTotal.insert(std::pair<std::string, uint64_t>(cudaName, 1));
} else {
foundT->second++;
}
map[cudaName]++;
mapTotal[cudaName]++;
}
virtual void updateCounters(const hipCounter &counter, const std::string &cudaName) {