Bug 1436832 - Remove unnecessary loop. r=sotaro
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 08 Feb 2018 17:11:42 -0500
changeset 752939 6e56d37b2096ba1b8e03460f2ab908a25cc2d8a8
parent 752938 3a096d205f992df9cf9f71f664a063d49fef6584
child 752940 64480155967fa3334d42cc17b03e6b9b5ba66e8e
push id98429
push usermak77@bonardo.net
push dateFri, 09 Feb 2018 10:14:12 +0000
reviewerssotaro
bugs1436832
milestone60.0a1
Bug 1436832 - Remove unnecessary loop. r=sotaro MozReview-Commit-ID: ehYAwXLecX
gfx/layers/wr/WebRenderBridgeParent.cpp
--- a/gfx/layers/wr/WebRenderBridgeParent.cpp
+++ b/gfx/layers/wr/WebRenderBridgeParent.cpp
@@ -1284,19 +1284,19 @@ WebRenderBridgeParent::LastPendingTransa
   }
   return id;
 }
 
 uint64_t
 WebRenderBridgeParent::FlushPendingTransactionIds()
 {
   uint64_t id = 0;
-  while (!mPendingTransactionIds.empty()) {
-    id = mPendingTransactionIds.front().mId;
-    mPendingTransactionIds.pop();
+  if (!mPendingTransactionIds.empty()) {
+    id = mPendingTransactionIds.back().mId;
+    std::queue<PendingTransactionId>().swap(mPendingTransactionIds); // clear queue
   }
   return id;
 }
 
 uint64_t
 WebRenderBridgeParent::FlushTransactionIdsForEpoch(const wr::Epoch& aEpoch, const TimeStamp& aEndTime)
 {
   uint64_t id = 0;