From 437d3ca0ea4844b7f0edddc0101c98096e7f0b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kleines=20Filmr=C3=B6llchen?= Date: Wed, 14 Dec 2022 13:23:02 +0100 Subject: [PATCH] Help: Use array size instead of sizeof to determine number of sections This was a relict when the sections were still a help-internal array. --- Userland/Applications/Help/ManualModel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Applications/Help/ManualModel.cpp b/Userland/Applications/Help/ManualModel.cpp index 1ad9fcf4dd..14df270453 100644 --- a/Userland/Applications/Help/ManualModel.cpp +++ b/Userland/Applications/Help/ManualModel.cpp @@ -123,7 +123,7 @@ GUI::ModelIndex ManualModel::parent_index(const GUI::ModelIndex& index) const return {}; if (parent->parent() == nullptr) { - for (size_t row = 0; row < sizeof(Manual::sections) / sizeof(Manual::sections[0]); row++) + for (size_t row = 0; row < Manual::sections.size(); row++) if (Manual::sections[row].ptr() == parent) return create_index(row, 0, parent); VERIFY_NOT_REACHED(); @@ -139,7 +139,7 @@ GUI::ModelIndex ManualModel::parent_index(const GUI::ModelIndex& index) const int ManualModel::row_count(const GUI::ModelIndex& index) const { if (!index.is_valid()) - return sizeof(Manual::sections) / sizeof(Manual::sections[0]); + return static_cast(Manual::sections.size()); auto* node = static_cast(index.internal_data()); return node->children().size(); }