Closed
Bug 517943
Opened 15 years ago
Closed 15 years ago
Need a way to append the contents of an nsTArray to another without copying
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
People
(Reporter: hsivonen, Assigned: hsivonen)
References
Details
Attachments
(1 file)
1.56 KB,
patch
|
benjamin
:
review+
dbaron
:
superreview+
|
Details | Diff | Splinter Review |
.Append() on nsTArray copy constucts. The HTML5 parser needs a method that moves stuff over from another nsTArray and empties the other array withou running constructors/destructors. (In order to move around tree operations without leaking or prematurely deleting members that aren't refcounted but deleted when the tree op goes away.)
Assignee | ||
Comment 1•15 years ago
|
||
Assignee | ||
Updated•15 years ago
|
Attachment #402066 -
Flags: review?(benjamin)
Updated•15 years ago
|
Attachment #402066 -
Flags: superreview?(dbaron)
Comment 2•15 years ago
|
||
Comment on attachment 402066 [details] [diff] [review] Add MoveElementsFrom to nsTArray No other parts of nsTArray will assign from another array without copy construction: this seems like an unfortunate design decision.
Assignee | ||
Comment 3•15 years ago
|
||
SwapElements() kind of assigns from another array without copy construction.
Summary: Need a way to append the contents of an nsTArray to another withou copying → Need a way to append the contents of an nsTArray to another without copying
Attachment #402066 -
Flags: superreview?(dbaron) → superreview+
Comment on attachment 402066 [details] [diff] [review] Add MoveElementsFrom to nsTArray sr=dbaron (assuming bsmedberg's review+), if you stick an NS_PRECONDITION(&array != this, "argument must be different array"); (or better assertion text) at the beginning
Updated•15 years ago
|
Attachment #402066 -
Flags: review?(benjamin) → review+
Comment 5•15 years ago
|
||
Comment on attachment 402066 [details] [diff] [review] Add MoveElementsFrom to nsTArray Please make the comment "Move all elements from another array to the end of this array without calling copy constructors or destructors."
Assignee | ||
Comment 6•15 years ago
|
||
Thank you for the reviews. Pushed with the changes suggested: http://hg.mozilla.org/mozilla-central/rev/f2a06414948c
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•