mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 12:08:14 +00:00
AK: Rename downcast<T> => verify_cast<T>
This makes it much clearer what this cast actually does: it will VERIFY that the thing we're casting is a T (using is<T>()).
This commit is contained in:
parent
6215a9c2cb
commit
ee3a73ddbb
61 changed files with 262 additions and 262 deletions
|
@ -245,7 +245,7 @@ public:
|
|||
{
|
||||
for_each_child([&](auto& child) {
|
||||
if (is<Widget>(child))
|
||||
return callback(downcast<Widget>(child));
|
||||
return callback(verify_cast<Widget>(child));
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
}
|
||||
|
@ -370,13 +370,13 @@ private:
|
|||
inline Widget* Widget::parent_widget()
|
||||
{
|
||||
if (parent() && is<Widget>(*parent()))
|
||||
return &downcast<Widget>(*parent());
|
||||
return &verify_cast<Widget>(*parent());
|
||||
return nullptr;
|
||||
}
|
||||
inline const Widget* Widget::parent_widget() const
|
||||
{
|
||||
if (parent() && is<Widget>(*parent()))
|
||||
return &downcast<const Widget>(*parent());
|
||||
return &verify_cast<const Widget>(*parent());
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue