diff options
author | Luke Wilde <lukew@serenityos.org> | 2022-01-30 23:42:57 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-02-26 12:53:32 +0100 |
commit | af3c8668987f9eec1403915231656d07ec816c2a (patch) | |
tree | d96196e6a19c1049c275f81c69e9f4e9e512e69b /Userland/Libraries | |
parent | 3d4411859503425af970c36152c254aafaa1619a (diff) | |
download | serenity-af3c8668987f9eec1403915231656d07ec816c2a.zip |
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.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibWeb/TreeNode.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/TreeNode.h b/Userland/Libraries/LibWeb/TreeNode.h index 8a9cc61bb8..038bab50a3 100644 --- a/Userland/Libraries/LibWeb/TreeNode.h +++ b/Userland/Libraries/LibWeb/TreeNode.h @@ -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; |