LibWeb: Make TreeNode::child_count return size_t instead of int

The primary benefit of this is that it's unsigned, as you can't have a
negative amount of children. Plus, all the users of child_count expect
it to be size_t.
This commit is contained in:
Luke Wilde 2022-01-30 23:42:57 +00:00 committed by Andreas Kling
parent 3d44118595
commit af3c866898
Notes: sideshowbarker 2024-07-17 18:14:47 +09:00

View File

@ -56,9 +56,9 @@ public:
const T* first_child() const { return m_first_child; }
const T* last_child() const { return m_last_child; }
int child_count() const
size_t child_count() const
{
int count = 0;
size_t count = 0;
for (auto* child = first_child(); child; child = child->next_sibling())
++count;
return count;