From 00bb447e551b3a5b669d4bf6d92e6571e521403d Mon Sep 17 00:00:00 2001 From: Chris Kitching Date: Wed, 25 Oct 2017 19:41:18 +0100 Subject: [PATCH] Prefer references to pointers in updateCountersExt() --- hipify-clang/src/Cuda2Hip.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/hipify-clang/src/Cuda2Hip.cpp b/hipify-clang/src/Cuda2Hip.cpp index dabcfe05ed..bc4bdb4587 100644 --- a/hipify-clang/src/Cuda2Hip.cpp +++ b/hipify-clang/src/Cuda2Hip.cpp @@ -175,21 +175,21 @@ protected: } void updateCountersExt(const hipCounter &counter, const std::string &cudaName) { - std::map *map = &cuda2hipConverted; - std::map *mapTotal = &cuda2hipConvertedTotal; + std::map& map = cuda2hipConverted; + std::map& 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(cudaName, 1)); + auto found = map.find(cudaName); + if (found == map.end()) { + map.insert(std::pair(cudaName, 1)); } else { found->second++; } - auto foundT = mapTotal->find(cudaName); - if (foundT == mapTotal->end()) { - mapTotal->insert(std::pair(cudaName, 1)); + auto foundT = mapTotal.find(cudaName); + if (foundT == mapTotal.end()) { + mapTotal.insert(std::pair(cudaName, 1)); } else { foundT->second++; }