Closed
Bug 217972
Opened 21 years ago
Closed 21 years ago
nsRDFDOMNodeList.cpp could use some cleanup
Categories
(Core :: XUL, defect)
Core
XUL
Tracking
()
RESOLVED
FIXED
People
(Reporter: keeda, Assigned: keeda)
Details
Attachments
(2 files, 3 obsolete files)
8.50 KB,
patch
|
jst
:
superreview+
|
Details | Diff | Splinter Review |
789 bytes,
patch
|
jst
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
I noticed that nsRDFDOMNodeList::CreateWithArray() was unused. Killing that meant that there no longer is any way of creating a nsRDFDOMNodeList that did not allocate its own mElements nsSupportsArray. So realized I might as well make it a member nsCOMArray. Init() is not doing anything useful anymore, so got rid of that too.
Assignee | ||
Comment 2•21 years ago
|
||
Assignee | ||
Updated•21 years ago
|
Attachment #130726 -
Flags: superreview?(jst)
Attachment #130726 -
Flags: review?(caillon)
Comment 3•21 years ago
|
||
Comment on attachment 130726 [details] [diff] [review] Fix nsRDFDOMNodeList::nsRDFDOMNodeList(void) - : //mInner(nsnull), Not being used? - mElements(nsnull) + : mElements(nsnull) No need to initialize mElements here, it'll do that itself automatically. nsresult nsRDFDOMNodeList::Create(nsRDFDOMNodeList** aResult) Maybe put a "// static" comment above this declaration? And maybe we should decomtaminate this and make it return the pointer in stead of a silly nsresult? Or maybe just eliminate the whole method and just make callers of this just call new nsRDFDOMNodeList (unless some silly factory code needs this method)? sr=jst
Attachment #130726 -
Flags: superreview?(jst) → superreview+
Comment 4•21 years ago
|
||
Comment on attachment 130726 [details] [diff] [review] Fix r=caillon with jst's comments addressed.
Attachment #130726 -
Flags: review?(caillon) → review+
Comment 5•21 years ago
|
||
Comment on attachment 130726 [details] [diff] [review] Fix >Index: nsRDFDOMNodeList.cpp >=================================================================== >+ NS_IF_ADDREF(*aReturn = mElements[aIndex]); Hmmm, I'd rather you don't do this, it'll do the assignment twice.
Comment 6•21 years ago
|
||
Peter, no it won't as NS_IF_ADDREF() macro expands to an inline function call. In fact it is better to do it this way, as Scott Collins noted in the following post: http://groups.google.com/groups?q=ns_if_addref&hl=en&lr=&ie=UTF-8&selm=scc-94B0C6.18202327022000%40news.mozilla.org&rnum=1
Comment 7•21 years ago
|
||
Ah cool, I stand corrected.
Assignee | ||
Comment 8•21 years ago
|
||
Changes from last time: 1) Got rid of the Create() as jst suggested and made all callsites do a new+addref. 2) While testing this, I ran into some nsVoidArray assertions. It appears, unlike nsSupportsArray::ElementAt(), nsCOMArray::ObjectAt() doesn't bound-check the underlying array. So I need some extra checks in nsRDFDOMNodeList::Item(). (Shouldnt nsCOMArray really be doing this internally?)
Assignee | ||
Updated•21 years ago
|
Attachment #130726 -
Attachment is obsolete: true
Assignee | ||
Comment 9•21 years ago
|
||
Don't need the conditional addref in Item() anymore.
Assignee | ||
Updated•21 years ago
|
Attachment #130903 -
Attachment is obsolete: true
Assignee | ||
Comment 10•21 years ago
|
||
Ugh.... This is what I wanted to attach.
Assignee | ||
Updated•21 years ago
|
Attachment #131215 -
Attachment is obsolete: true
Assignee | ||
Comment 11•21 years ago
|
||
Comment on attachment 131216 [details] [diff] [review] attach the correct patch jst, can you please have another quick look at this.
Attachment #131216 -
Flags: superreview?(jst)
Comment 12•21 years ago
|
||
Comment on attachment 131216 [details] [diff] [review] attach the correct patch Looks good! sr=jst
Attachment #131216 -
Flags: superreview?(jst) → superreview+
Assignee | ||
Comment 13•21 years ago
|
||
Checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Comment 14•21 years ago
|
||
This commit have added a warning on brad TBox: +content/xul/document/src/nsXULDocument.cpp:1503 + `nsresult rv' might be used uninitialized in this function
Assignee | ||
Comment 15•21 years ago
|
||
Arrrgh ... silly signedness. aIndex is unsigned. The less than 0 check is pointless. Casting that return from Count() should be the right way to shut up the compiler since Count() never returns a negative value.
Assignee | ||
Comment 16•21 years ago
|
||
Comment on attachment 131885 [details] [diff] [review] Warning fix jst, this is a ultra-trivial one liner to kill a warning that I introduced the other day. quick r+sr ?
Attachment #131885 -
Flags: superreview?(jst)
Attachment #131885 -
Flags: review?(jst)
Comment 17•21 years ago
|
||
Comment on attachment 131885 [details] [diff] [review] Warning fix r+sr=jst
Attachment #131885 -
Flags: superreview?(jst)
Attachment #131885 -
Flags: superreview+
Attachment #131885 -
Flags: review?(jst)
Attachment #131885 -
Flags: review+
Assignee | ||
Comment 18•21 years ago
|
||
Comment on attachment 131885 [details] [diff] [review] Warning fix checked in
Comment 19•21 years ago
|
||
The warning from comment #14 is still there.
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: shrir → xptoolkit.widgets
You need to log in
before you can comment on or make changes to this bug.
Description
•