Closed Bug 826541 Opened 11 years ago Closed 11 years ago

Suboptimal string copying in nsAttrValue::ToString

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: neil, Assigned: neil)

References

Details

Attachments

(1 file)

(In reply to Boris Zbarsky from bug 760331 comment #8)
> (From update of attachment 665541 [details] [diff] [review])
> > +MiscContainer::Cache()
> > +  nsString str;
> You could probaly just use an nsDependentString
Unfortunately nsAttrValue::ToString ends up copying the dependent string to its outparam, whereas with nsAString& it could simply forward the retval.
Attached patch Proposed patchSplinter Review
Assignee: nobody → neil
Status: NEW → ASSIGNED
Attachment #697726 - Flags: review?(bzbarsky)
Comment on attachment 697726 [details] [diff] [review]
Proposed patch

r=me.  Nice catch.
Attachment #697726 - Flags: review?(bzbarsky) → review+
https://hg.mozilla.org/mozilla-central/rev/587a0a974cf8
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: