Suboptimal string copying in nsAttrValue::ToString

RESOLVED FIXED in mozilla20

Status

()

defect
--
minor
RESOLVED FIXED
7 years ago
4 months ago

People

(Reporter: neil, Assigned: neil)

Tracking

unspecified
mozilla20
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(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.
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: 7 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.