LibWeb: Use static_cast<HTMLTemplateElement> right after an is<> check

The double verify_cast here was just barely visible in a profile.
This commit is contained in:
Andreas Kling 2024-07-20 14:47:18 +02:00 committed by Andreas Kling
parent f9f11dc51d
commit 7dacd6be89
Notes: github-actions[bot] 2024-07-20 13:36:22 +00:00

View file

@ -664,7 +664,7 @@ HTMLParser::AdjustedInsertionLocation HTMLParser::find_appropriate_place_for_ins
// 3. If the adjusted insertion location is inside a template element,
// let it instead be inside the template element's template contents, after its last child (if any).
if (is<HTMLTemplateElement>(*adjusted_insertion_location.parent))
adjusted_insertion_location = { verify_cast<HTMLTemplateElement>(*adjusted_insertion_location.parent).content().ptr(), nullptr };
adjusted_insertion_location = { static_cast<HTMLTemplateElement const&>(*adjusted_insertion_location.parent).content().ptr(), nullptr };
// 4. Return the adjusted insertion location.
return adjusted_insertion_location;