Prefer references to pointers in updateCountersExt()

[ROCm/hip commit: 00bb447e55]
Этот коммит содержится в:
Chris Kitching committed 2017-10-27 20:12:32 +01:00
1 родитель 25517e41fd
Коммит 51df5b20c9
1 file changed
+10 -10
+10 -10
Просмотреть файл
@@ -175,21 +175,21 @@ protected:
}
void updateCountersExt(const hipCounter &counter, const std::string &cudaName) {
std::map<std::string, uint64_t> *map = &cuda2hipConverted;
std::map<std::string, uint64_t> *mapTotal = &cuda2hipConvertedTotal;
std::map<std::string, uint64_t>& map = cuda2hipConverted;
std::map<std::string, uint64_t>& mapTotal = cuda2hipConvertedTotal;
if (counter.unsupported) {
map = &cuda2hipUnconverted;
mapTotal = &cuda2hipUnconvertedTotal;
map = cuda2hipUnconverted;
mapTotal = cuda2hipUnconvertedTotal;
}
auto found = map->find(cudaName);
if (found == map->end()) {
map->insert(std::pair<std::string, uint64_t>(cudaName, 1));
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));
auto foundT = mapTotal.find(cudaName);
if (foundT == mapTotal.end()) {
mapTotal.insert(std::pair<std::string, uint64_t>(cudaName, 1));
} else {
foundT->second++;
}