style: Add a fast path to each_anonymous_content_child.

If we know that we don't have anon children it is pointless to go through FFI.
This commit is contained in:
Emilio Cobos Álvarez 2018-03-30 21:06:34 +02:00
parent d232705106
commit f815d2f9c6
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -1121,6 +1121,10 @@ impl<'le> TElement for GeckoElement<'le> {
where
F: FnMut(Self),
{
if !self.may_have_anonymous_children() {
return;
}
let array: *mut structs::nsTArray<*mut nsIContent> =
unsafe { bindings::Gecko_GetAnonymousContentForElement(self.0) };