Bug 1317973 - Converts for(...; ...; ...) loops to use the new range-based loops in C++11. r=nical
authorSylvestre Ledru <sledru@mozilla.com>
Thu, 01 Dec 2016 12:06:43 +0100
changeset 324913 8b1670f7a0b4b1103b3d88be98c61d0d7a9ba01d
parent 324912 e36b4963793fe08d4c6f7d02a6fe753a72a0c86a
child 324914 d2bfabe4d0150f2c168f1c5830111a1753124f9c
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersnical
bugs1317973
milestone53.0a1
Bug 1317973 - Converts for(...; ...; ...) loops to use the new range-based loops in C++11. r=nical MozReview-Commit-ID: 8QKcHVaVtPT
widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -492,24 +492,24 @@ nsWindow::~nsWindow()
     mTransparencyBitmap = nullptr;
 
     Destroy();
 }
 
 /* static */ void
 nsWindow::ReleaseGlobals()
 {
-  for (uint32_t i = 0; i < ArrayLength(gCursorCache); ++i) {
-    if (gCursorCache[i]) {
+  for (auto & cursor : gCursorCache) {
+    if (cursor) {
 #if (MOZ_WIDGET_GTK == 3)
-      g_object_unref(gCursorCache[i]);
+      g_object_unref(cursor);
 #else
-      gdk_cursor_unref(gCursorCache[i]);
+      gdk_cursor_unref(cursor);
 #endif
-      gCursorCache[i] = nullptr;
+      cursor = nullptr;
     }
   }
 }
 
 void
 nsWindow::CommonCreate(nsIWidget *aParent, bool aListenForResizes)
 {
     mParent = aParent;