r369581 - Use C++14 heteregenous lookup for a couple of std::map<std::string, ...>

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 21 14:17:34 PDT 2019


Author: d0k
Date: Wed Aug 21 14:17:34 2019
New Revision: 369581

URL: http://llvm.org/viewvc/llvm-project?rev=369581&view=rev
Log:
Use C++14 heteregenous lookup for a couple of std::map<std::string, ...>

These call find with a StringRef, heterogenous lookup saves a temporary
std::string there.

Modified:
    cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h

Modified: cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h?rev=369581&r1=369580&r2=369581&view=diff
==============================================================================
--- cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h (original)
+++ cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h Wed Aug 21 14:17:34 2019
@@ -183,7 +183,8 @@ public:
   /// Note that we're using std::map here, as for memoization:
   /// - we need a comparison operator
   /// - we need an assignment operator
-  using IDToNodeMap = std::map<std::string, ast_type_traits::DynTypedNode>;
+  using IDToNodeMap =
+      std::map<std::string, ast_type_traits::DynTypedNode, std::less<>>;
 
   const IDToNodeMap &getMap() const {
     return NodeMap;




More information about the cfe-commits mailing list