Bug 1317973 - Converts for(...; ...; ...) loops to use the new range-based loops in C++11.
MozReview-Commit-ID: 8QKcHVaVtPT
--- 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;