Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1011)

Unified Diff: base/task_scheduler/scheduler_thread_pool.cc

Issue 1901223003: base: Remove a copy of and copy ctor from SequenceAndSortKey. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/task_scheduler/priority_queue.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/scheduler_thread_pool.cc
diff --git a/base/task_scheduler/scheduler_thread_pool.cc b/base/task_scheduler/scheduler_thread_pool.cc
index b00990bb82945e8026f5cb5ad263462e39277863..4d08866ddbccf82b2e28ff73d4c768dc858d499d 100644
--- a/base/task_scheduler/scheduler_thread_pool.cc
+++ b/base/task_scheduler/scheduler_thread_pool.cc
@@ -238,7 +238,7 @@ SchedulerThreadPool::SchedulerWorkerThreadDelegateImpl::GetWork(
SchedulerWorkerThread* worker_thread) {
std::unique_ptr<PriorityQueue::Transaction> transaction(
outer_->shared_priority_queue_.BeginTransaction());
- const auto sequence_and_sort_key = transaction->Peek();
+ const auto& sequence_and_sort_key = transaction->Peek();
if (sequence_and_sort_key.is_null()) {
// |transaction| is kept alive while |worker_thread| is added to
@@ -257,8 +257,9 @@ SchedulerThreadPool::SchedulerWorkerThreadDelegateImpl::GetWork(
return nullptr;
}
+ scoped_refptr<Sequence> sequence = sequence_and_sort_key.sequence;
transaction->Pop();
- return sequence_and_sort_key.sequence;
+ return sequence;
}
void SchedulerThreadPool::SchedulerWorkerThreadDelegateImpl::EnqueueSequence(
« no previous file with comments | « base/task_scheduler/priority_queue.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698