Avoid redundant map/set searches in various ProfileFunc methods

This commit is contained in:
Jon Siwek 2021-03-31 14:48:02 -07:00
parent ab1f1f8360
commit ccd27a3dfa
2 changed files with 32 additions and 21 deletions

View file

@ -316,8 +316,9 @@ public:
// the parameter (which might be the parameter itself).
const Type* TypeRep(const Type* orig)
{
ASSERT(type_to_rep.count(orig) > 0);
return type_to_rep[orig];
auto it = type_to_rep.find(orig);
ASSERT(it != type_to_rep.end());
return it->second;
}
// Returns the hash associated with the given type, computing it