File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -216,7 +216,7 @@ class Term final {
216
216
Term () {}
217
217
218
218
explicit Term (llvm::SmallVector<Atom, 3 > &&atoms)
219
- : Atoms(atoms) {}
219
+ : Atoms(std::move( atoms) ) {}
220
220
221
221
explicit Term (ArrayRef<Atom> atoms)
222
222
: Atoms(atoms.begin(), atoms.end()) {}
Original file line number Diff line number Diff line change @@ -1843,9 +1843,10 @@ RequirementMachine *ASTContext::getOrCreateRequirementMachine(
1843
1843
// signature.
1844
1844
auto arena = getArena (sig);
1845
1845
auto &machines = getImpl ().getArena (arena).RequirementMachines ;
1846
- auto known = machines.find (sig);
1847
- if (known != machines.end ()) {
1848
- auto *machine = known->second .get ();
1846
+
1847
+ auto &machinePtr = machines[sig];
1848
+ if (machinePtr) {
1849
+ auto *machine = machinePtr.get ();
1849
1850
if (!machine->isComplete ()) {
1850
1851
llvm::errs () << " Re-entrant construction of requirement "
1851
1852
<< " machine for " << sig << " \n " ;
@@ -1855,12 +1856,12 @@ RequirementMachine *ASTContext::getOrCreateRequirementMachine(
1855
1856
return machine;
1856
1857
}
1857
1858
1858
- // Create a new requirement machine with the given signature.
1859
- auto machine = new RequirementMachine (*this );
1859
+ auto *machine = new RequirementMachine (*this );
1860
1860
1861
1861
// Store this requirement machine before adding the signature,
1862
- // to catch re-entrant construction.
1863
- machines[sig] = std::unique_ptr<RequirementMachine>(machine);
1862
+ // to catch re-entrant construction via addGenericSignature()
1863
+ // below.
1864
+ machinePtr = std::unique_ptr<RequirementMachine>(machine);
1864
1865
1865
1866
machine->addGenericSignature (sig);
1866
1867
You can’t perform that action at this time.
0 commit comments