Bug 1317973 - Converts for(...; ...; ...) loops to use the new range-based loops in C++11. draft
authorSylvestre Ledru <sledru@mozilla.com>
Thu, 01 Dec 2016 12:06:43 +0100
changeset 446406 535ba2d415c2c16c34794e4e55a4c5cda4befa3a
parent 439623 7d3a1d837a646e2a08b1218cb50417d8ad6db51c
child 446407 80175c2b87e09038098690d0fcc4efa12b30cf89
push id37794
push usersledru@mozilla.com
push dateThu, 01 Dec 2016 11:08:44 +0000
bugs1317973
milestone53.0a1
Bug 1317973 - Converts for(...; ...; ...) loops to use the new range-based loops in C++11. 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;