File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -905,14 +905,10 @@ clang::QualType ClangTypeConverter::convertTemplateArgument(Type type) {
905
905
// a handful of Swift builtin types. These are enumerated here rather than
906
906
// delegated to ClangTypeConverter::convert() (which is more general).
907
907
auto withCache = [&](auto lookup) {
908
- auto cached = Cache.find (type);
909
- if (cached != Cache.end ())
910
- return cached->second ;
911
-
912
- auto result = lookup ();
913
- if (!result.isNull ())
914
- Cache.insert ({type, result});
915
- return result;
908
+ auto [it, inserted] = Cache.try_emplace (type, clang::QualType{});
909
+ if (!inserted)
910
+ it->second = lookup ();
911
+ return it->second ;
916
912
};
917
913
918
914
// This type was imported from Clang, so we can convert it back by retrieving
You can’t perform that action at this time.
0 commit comments