mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 22:52:22 +02:00
`SlottableMixin::assigned_slot()` was using `as<DOM::Node>(*this)` to get a `Node` reference. Since `SlottableMixin` has no inheritance relationship with `Node`, `as_if<>` can't use `static_cast` and falls through to `dynamic_cast`, which is expensive. Replace this with a virtual `slottable_as_node()` accessor overridden in `Element` and `Text`. This showed up as hot in profiles when loading the GC heap explorer page.
1.6 KiB
1.6 KiB