From af3c8668987f9eec1403915231656d07ec816c2a Mon Sep 17 00:00:00 2001 From: Luke Wilde Date: Sun, 30 Jan 2022 23:42:57 +0000 Subject: [PATCH] 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. --- Userland/Libraries/LibWeb/TreeNode.h | 4 ++-- 1 file 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;