mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
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:
parent
3d44118595
commit
af3c866898
Notes:
sideshowbarker
2024-07-17 18:14:47 +09:00
Author: https://github.com/Lubrsi Commit: https://github.com/SerenityOS/serenity/commit/af3c866898 Pull-request: https://github.com/SerenityOS/serenity/pull/12774
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user