mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-12 12:32:21 +00:00
LibWeb: Add fast_is<T>() for some DOM and layout node subclasses
The generic is<T>() uses dynamic_cast which is fine in the majority of cases, but when one of them shows up in profiles, we can make it faster by answering the is-a question manually.
This commit is contained in:
parent
65fa0c2774
commit
fd441b954d
Notes:
sideshowbarker
2024-07-18 23:08:36 +09:00
Author: https://github.com/awesomekling
Commit: fd441b954d
7 changed files with 24 additions and 17 deletions
|
@ -134,13 +134,7 @@ private:
|
|||
OwnPtr<StackingContext> m_stacking_context;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace AK {
|
||||
template<>
|
||||
inline bool is<Web::Layout::Box>(const Web::Layout::Node& input)
|
||||
{
|
||||
return input.is_box();
|
||||
}
|
||||
inline bool Node::fast_is<Box>() const { return is_box(); }
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue