Bug 1206564 - skip copying of listeners. r=roc, a=sylvestre
authorKarl Tomlinson <karlt+@karlt.net>
Sat, 19 Sep 2015 00:51:03 +1200
changeset 296129 663c99a20a9b25370cdfe0acc8b70197fddd4c6d
parent 296128 6ea3a333b3883d06ad496b0f6d4b10a57aa932e9
child 296130 4c2d05f5523c61e430231704fad511f2bc6cef00
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, sylvestre
bugs1206564
milestone43.0a2
Bug 1206564 - skip copying of listeners. r=roc, a=sylvestre
widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -511,22 +511,21 @@ nsWindow::DispatchDeactivateEvent(void)
 #ifdef ACCESSIBILITY
     DispatchDeactivateEventAccessible();
 #endif //ACCESSIBILITY
 }
 
 void
 nsWindow::DispatchResized(int32_t aWidth, int32_t aHeight)
 {
-    nsIWidgetListener *listeners[] =
-        { mWidgetListener, mAttachedWidgetListener };
-    for (size_t i = 0; i < ArrayLength(listeners); ++i) {
-        if (listeners[i]) {
-            listeners[i]->WindowResized(this, aWidth, aHeight);
-        }
+    if (mWidgetListener) {
+        mWidgetListener->WindowResized(this, aWidth, aHeight);
+    }
+    if (mAttachedWidgetListener) {
+        mAttachedWidgetListener->WindowResized(this, aWidth, aHeight);
     }
 }
 
 nsresult
 nsWindow::DispatchEvent(WidgetGUIEvent* aEvent, nsEventStatus& aStatus)
 {
 #ifdef DEBUG
     debug_DumpEvent(stdout, aEvent->widget, aEvent,