================
@@ -70,12 +70,13 @@ static FixItHint getCallFixItHint(const ObjCMessageExpr
*Expr,
StringRef Receiver =
getReceiverString(Expr->getReceiverRange(), SM, LangOpts);
// Some classes should use standard factory methods instead of alloc/init.
- std::map<StringRef, StringRef> ClassToFactoryMethodMap = {{"NSDate", "date"},
- {"NSNull",
"null"}};
- auto FoundClassFactory = ClassToFactoryMethodMap.find(Receiver);
- if (FoundClassFactory != ClassToFactoryMethodMap.end()) {
- StringRef ClassName = FoundClassFactory->first;
- StringRef FactorySelector = FoundClassFactory->second;
+ static constexpr std::pair<StringRef, StringRef> ClassToFactoryMethodMap[] =
{
----------------
EugeneZelenko wrote:
Please include `utility` instead of `map`.
https://github.com/llvm/llvm-project/pull/174357
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits