Closed Bug 1395945 Opened 2 years ago Closed 2 years ago

Remove child array getter

Categories

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

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: catalinb, Assigned: catalinb)

References

Details

Attachments

(1 file)

This is an easy one. Get rid of ::GetChildArray.
Attachment #8903571 - Flags: review?(ehsan)
Comment on attachment 8903571 [details] [diff] [review]
Remove child array getter.

Review of attachment 8903571 [details] [diff] [review]:
-----------------------------------------------------------------

Nice, thank you!

::: dom/base/nsINode.h
@@ +1281,2 @@
>  
> +    return count > 0 ? GetChildAt(count - 1) : nullptr;

Hmm...  Do we have a plan to get rid of this call to GetChildAt() at some point too somehow?
Attachment #8903571 - Flags: review?(ehsan) → review+
(In reply to :Ehsan Akhgari (needinfo please, extremely long backlog) from comment #2)
> Comment on attachment 8903571 [details] [diff] [review]
> Remove child array getter.
> 
> Review of attachment 8903571 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Nice, thank you!
> 
> ::: dom/base/nsINode.h
> @@ +1281,2 @@
> >  
> > +    return count > 0 ? GetChildAt(count - 1) : nullptr;
> 
> Hmm...  Do we have a plan to get rid of this call to GetChildAt() at some
> point too somehow?

Yes, GetLastChild() will return mFirstChild->mPreviousChild which is the last child.
https://hg.mozilla.org/mozilla-central/rev/b137fb389c95
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.