mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 19:17:41 +00:00
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.
This commit is contained in:
parent
1ec0548158
commit
437d3ca0ea
1 changed files with 2 additions and 2 deletions
|
@ -123,7 +123,7 @@ GUI::ModelIndex ManualModel::parent_index(const GUI::ModelIndex& index) const
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
if (parent->parent() == nullptr) {
|
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)
|
if (Manual::sections[row].ptr() == parent)
|
||||||
return create_index(row, 0, parent);
|
return create_index(row, 0, parent);
|
||||||
VERIFY_NOT_REACHED();
|
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
|
int ManualModel::row_count(const GUI::ModelIndex& index) const
|
||||||
{
|
{
|
||||||
if (!index.is_valid())
|
if (!index.is_valid())
|
||||||
return sizeof(Manual::sections) / sizeof(Manual::sections[0]);
|
return static_cast<int>(Manual::sections.size());
|
||||||
auto* node = static_cast<Manual::Node const*>(index.internal_data());
|
auto* node = static_cast<Manual::Node const*>(index.internal_data());
|
||||||
return node->children().size();
|
return node->children().size();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue