Bug 1277222 - don't needlessly copy a string in XULDocument::MaybeBroadcast; r=smaug

The listener's SetAttr method takes a |const nsAString&|, so copying the
string in any form before passing it is just needless work.
This commit is contained in:
Nathan Froyd 2016-06-01 16:18:01 -04:00
parent 14bcc45698
commit 760e7a2a76

View File

@ -3148,7 +3148,7 @@ XULDocument::MaybeBroadcast()
if (mDelayedAttrChangeBroadcasts[i].mNeedsAttrChange) {
nsCOMPtr<nsIContent> listener =
do_QueryInterface(mDelayedAttrChangeBroadcasts[i].mListener);
nsString value = mDelayedAttrChangeBroadcasts[i].mAttr;
const nsString& value = mDelayedAttrChangeBroadcasts[i].mAttr;
if (mDelayedAttrChangeBroadcasts[i].mSetAttr) {
listener->SetAttr(kNameSpaceID_None, attrName, value,
true);