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 324880 8b1670f7a0b4b1103b3d88be98c61d0d7a9ba01d
parent 324879 e36b4963793fe08d4c6f7d02a6fe753a72a0c86a
child 324881 d2bfabe4d0150f2c168f1c5830111a1753124f9c
push id31022
push userkwierso@gmail.com
push dateThu, 01 Dec 2016 23:07:35 +0000
treeherdermozilla-central@9b8bf5feb0b5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1317973
milestone53.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 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;