[clang] [NFC][Clang] Use StringRef instead of string in ClangDiagnosticEmitter (PR #115959)

Kazu Hirata via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 12 22:58:43 PST 2024


================
@@ -145,7 +146,7 @@ static bool diagGroupBeforeByName(const Record *LHS, const Record *RHS) {
          RHS->getValueAsString("GroupName");
 }
 
-using DiagsInGroupTy = std::map<std::string, GroupInfo, std::less<>>;
+using DiagsInGroupTy = std::map<StringRef, GroupInfo, std::less<>>;
----------------
kazutakahirata wrote:

If you are putting `StringRef`, I'd drop `std::less<>`.  We don't need to support heterogenous lookups if the key is of `StringRef`.

https://github.com/llvm/llvm-project/pull/115959


More information about the cfe-commits mailing list