Bug 1387002 - Replace .size() by .empty() when applicable in xpcom/ r=froydnj
authorSylvestre Ledru <sledru@mozilla.com>
Thu, 03 Aug 2017 12:08:32 +0200
changeset 374038 054d2e90007ef2f65f38ba1f4f7224b49bf9a4b5
parent 374037 7f976dd75f7a41d0baedcbf544601a467d1b1800
child 374039 ce922d08f2816f3090c421f411c4441e23ca43f0
push id32312
push userarchaeopteryx@coole-files.de
push dateFri, 11 Aug 2017 09:55:13 +0000
treeherdermozilla-central@f74094603063 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1387002
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1387002 - Replace .size() by .empty() when applicable in xpcom/ r=froydnj MozReview-Commit-ID: LWzpVGVV7Py
xpcom/threads/TaskQueue.cpp
--- a/xpcom/threads/TaskQueue.cpp
+++ b/xpcom/threads/TaskQueue.cpp
@@ -220,17 +220,17 @@ TaskQueue::WrapAsEventTarget()
 
 nsresult
 TaskQueue::Runner::Run()
 {
   RefPtr<nsIRunnable> event;
   {
     MonitorAutoLock mon(mQueue->mQueueMonitor);
     MOZ_ASSERT(mQueue->mIsRunning);
-    if (mQueue->mTasks.size() == 0) {
+    if (mQueue->mTasks.empty()) {
       mQueue->mIsRunning = false;
       mQueue->MaybeResolveShutdown();
       mon.NotifyAll();
       return NS_OK;
     }
     event = mQueue->mTasks.front().forget();
     mQueue->mTasks.pop();
   }
@@ -250,17 +250,17 @@ TaskQueue::Runner::Run()
   // object it's calling, and we don't want to keep it alive, it may be
   // making assumptions what holds references to it. This is especially
   // the case if the object is waiting for us to shutdown, so that it
   // can shutdown (like in the MediaDecoderStateMachine's SHUTDOWN case).
   event = nullptr;
 
   {
     MonitorAutoLock mon(mQueue->mQueueMonitor);
-    if (mQueue->mTasks.size() == 0) {
+    if (mQueue->mTasks.empty()) {
       // No more events to run. Exit the task runner.
       mQueue->mIsRunning = false;
       mQueue->MaybeResolveShutdown();
       mon.NotifyAll();
       return NS_OK;
     }
   }