From 1c6c7573e9ffa95058adc9d185d205b1e59b3d70 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Mon, 8 Sep 2014 18:44:12 -0700 Subject: [PATCH] Don't pollute the namespace for two uses. Clang complains about ambiguity between std::hash and ::hash (locally defined). There's no need to pull in the whole namespace for two uses of std::map anyway. Change-Id: Icbaa7ebbaad05999988784ad34662c721fb12b29 --- tools/aapt/ResourceIdCache.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/aapt/ResourceIdCache.cpp b/tools/aapt/ResourceIdCache.cpp index e03f4f668a1e7..359443d8fca0d 100644 --- a/tools/aapt/ResourceIdCache.cpp +++ b/tools/aapt/ResourceIdCache.cpp @@ -9,7 +9,6 @@ #include #include "ResourceIdCache.h" #include -using namespace std; static size_t mHits = 0; @@ -29,7 +28,7 @@ struct CacheEntry { CacheEntry(const android::String16& name, uint32_t resId) : hashedName(name), id(resId) { } }; -static map< uint32_t, CacheEntry > mIdMap; +static std::map< uint32_t, CacheEntry > mIdMap; // djb2; reasonable choice for strings when collisions aren't particularly important @@ -63,7 +62,7 @@ uint32_t ResourceIdCache::lookup(const android::String16& package, bool onlyPublic) { const String16 hashedName = makeHashableName(package, type, name, onlyPublic); const uint32_t hashcode = hash(hashedName); - map::iterator item = mIdMap.find(hashcode); + std::map::iterator item = mIdMap.find(hashcode); if (item == mIdMap.end()) { // cache miss mMisses++;