Replace MergeSets() with std::set::merge().
And clear up ownership of the VerifierDeps being merged
by using std::unique_ptr<>.
Test: m test-art-host-gtest
Test: testrunner.py --host
Bug: 123750182
Change-Id: Id4ffa9f9fa1968fa762b9e825f25827240f6d45d
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index 56333b6..d9c0bf3 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -1928,10 +1928,10 @@
// Merge all VerifierDeps into the main one.
verifier::VerifierDeps* verifier_deps = Thread::Current()->GetVerifierDeps();
for (ThreadPoolWorker* worker : parallel_thread_pool_->GetWorkers()) {
- verifier::VerifierDeps* thread_deps = worker->GetThread()->GetVerifierDeps();
- worker->GetThread()->SetVerifierDeps(nullptr);
- verifier_deps->MergeWith(*thread_deps, GetCompilerOptions().GetDexFilesForOatFile());
- delete thread_deps;
+ std::unique_ptr<verifier::VerifierDeps> thread_deps(worker->GetThread()->GetVerifierDeps());
+ worker->GetThread()->SetVerifierDeps(nullptr); // We just took ownership.
+ verifier_deps->MergeWith(std::move(thread_deps),
+ GetCompilerOptions().GetDexFilesForOatFile());
}
Thread::Current()->SetVerifierDeps(nullptr);
}