diff --git a/content/events/src/nsDOMEvent.cpp b/content/events/src/nsDOMEvent.cpp index 9c5ac332263..5a574338654 100644 --- a/content/events/src/nsDOMEvent.cpp +++ b/content/events/src/nsDOMEvent.cpp @@ -1060,11 +1060,7 @@ NS_METHOD nsDOMEvent::GetPreventDefault(PRBool* aReturn) nsresult nsDOMEvent::SetEventType(const nsAReadableString& aEventTypeArg) { - nsAutoString str; str.AssignWithConversion("on"); - nsIAtom* atom; - - str.Append(aEventTypeArg); - atom = NS_NewAtom(str); + nsCOMPtr atom(dont_AddRef(NS_NewAtom(NS_LITERAL_STRING("on") + aEventTypeArg))); if (atom == nsLayoutAtoms::onmousedown && mEvent->eventStructType == NS_MOUSE_EVENT) { mEvent->message = NS_MOUSE_LEFT_BUTTON_DOWN;