From 68e49f6d48f94bd87342ba4ba717fbe0a9a1c1cf Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Tue, 5 Jul 2016 18:49:06 -0400 Subject: [PATCH] Bug 1283617 - remove QI call when constructing AsyncEventDispatchers from WidgetEvents; r=baku The compiler can just as easily do this cast for us; we don't have to rely on QI, and doing the conversion this way even saves an AddRef/Release pair. --- dom/events/AsyncEventDispatcher.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom/events/AsyncEventDispatcher.cpp b/dom/events/AsyncEventDispatcher.cpp index 43cd09443c1f..10c46273bda7 100644 --- a/dom/events/AsyncEventDispatcher.cpp +++ b/dom/events/AsyncEventDispatcher.cpp @@ -27,7 +27,7 @@ AsyncEventDispatcher::AsyncEventDispatcher(EventTarget* aTarget, MOZ_ASSERT(mTarget); RefPtr event = EventDispatcher::CreateEvent(aTarget, nullptr, &aEvent, EmptyString()); - mEvent = do_QueryInterface(event); + mEvent = event.forget(); NS_ASSERTION(mEvent, "Should never fail to create an event"); mEvent->DuplicatePrivateData(); mEvent->SetTrusted(aEvent.IsTrusted());