@@ -173,10 +173,11 @@ class LVForwardReferences {
173
173
174
174
// Update a previously recorded forward reference with its definition.
175
175
void update (StringRef Name, TypeIndex TIReference) {
176
- if (ForwardTypesNames.find (Name) != ForwardTypesNames.end ()) {
176
+ auto It = ForwardTypesNames.find (Name);
177
+ if (It != ForwardTypesNames.end ()) {
177
178
// Update the recorded forward reference with its definition.
178
- ForwardTypesNames[Name] .second = TIReference;
179
- add (ForwardTypesNames[Name] .first , TIReference);
179
+ It-> second .second = TIReference;
180
+ add (It-> second .first , TIReference);
180
181
} else {
181
182
// We have not seen the forward reference. Insert the definition.
182
183
ForwardTypesNames.emplace (
@@ -196,15 +197,14 @@ class LVForwardReferences {
196
197
}
197
198
198
199
TypeIndex find (TypeIndex TIForward) {
199
- return (ForwardTypes.find (TIForward) != ForwardTypes.end ())
200
- ? ForwardTypes[TIForward]
201
- : TypeIndex::None ();
200
+ auto It = ForwardTypes.find (TIForward);
201
+ return It != ForwardTypes.end () ? It->second : TypeIndex::None ();
202
202
}
203
203
204
204
TypeIndex find (StringRef Name) {
205
- return (ForwardTypesNames. find (Name) ! = ForwardTypesNames.end ())
206
- ? ForwardTypesNames[Name] .second
207
- : TypeIndex::None ();
205
+ auto It = ForwardTypesNames.find (Name);
206
+ return It != ForwardTypesNames. end () ? It-> second .second
207
+ : TypeIndex::None ();
208
208
}
209
209
210
210
// If the given TI corresponds to a reference, return the reference.
@@ -242,9 +242,8 @@ class LVNamespaceDeduction {
242
242
243
243
// Find the logical namespace for the 'Name' component.
244
244
LVScope *find (StringRef Name) {
245
- LVScope *Namespace = (NamespaceNames.find (Name) != NamespaceNames.end ())
246
- ? NamespaceNames[Name]
247
- : nullptr ;
245
+ auto It = NamespaceNames.find (Name);
246
+ LVScope *Namespace = It != NamespaceNames.end () ? It->second : nullptr ;
248
247
return Namespace;
249
248
}
250
249
0 commit comments