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 {
216216 Term () {}
217217
218218 explicit Term (llvm::SmallVector<Atom, 3 > &&atoms)
219- : Atoms(atoms) {}
219+ : Atoms(std::move( atoms) ) {}
220220
221221 explicit Term (ArrayRef<Atom> atoms)
222222 : Atoms(atoms.begin(), atoms.end()) {}
Original file line number Diff line number Diff line change @@ -1843,9 +1843,10 @@ RequirementMachine *ASTContext::getOrCreateRequirementMachine(
18431843 // signature.
18441844 auto arena = getArena (sig);
18451845 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 ();
18491850 if (!machine->isComplete ()) {
18501851 llvm::errs () << " Re-entrant construction of requirement "
18511852 << " machine for " << sig << " \n " ;
@@ -1855,12 +1856,12 @@ RequirementMachine *ASTContext::getOrCreateRequirementMachine(
18551856 return machine;
18561857 }
18571858
1858- // Create a new requirement machine with the given signature.
1859- auto machine = new RequirementMachine (*this );
1859+ auto *machine = new RequirementMachine (*this );
18601860
18611861 // 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);
18641865
18651866 machine->addGenericSignature (sig);
18661867
You can’t perform that action at this time.
0 commit comments