1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 21:58:12 +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:
Andreas Kling 2021-06-24 19:53:42 +02:00
parent 6215a9c2cb
commit ee3a73ddbb
61 changed files with 262 additions and 262 deletions

View file

@ -34,7 +34,7 @@ bool Position::increment_offset()
if (!is<DOM::Text>(*m_node))
return false;
auto& node = downcast<DOM::Text>(*m_node);
auto& node = verify_cast<DOM::Text>(*m_node);
auto text = Utf8View(node.data());
for (auto iterator = text.begin(); !iterator.done(); ++iterator) {
@ -53,7 +53,7 @@ bool Position::decrement_offset()
if (m_offset == 0 || !is<DOM::Text>(*m_node))
return false;
auto& node = downcast<DOM::Text>(*m_node);
auto& node = verify_cast<DOM::Text>(*m_node);
auto text = Utf8View(node.data());
size_t last_smaller_offset = 0;
@ -76,7 +76,7 @@ bool Position::offset_is_at_end_of_node() const
if (!is<DOM::Text>(*m_node))
return false;
auto& node = downcast<DOM::Text>(*m_node);
auto& node = verify_cast<DOM::Text>(*m_node);
auto text = node.data();
return m_offset == text.length();
}