diff options
author | Luca Di Sera <luca.disera@qt.io> | 2022-11-30 09:18:09 +0100 |
---|---|---|
committer | Luca Di Sera <luca.disera@qt.io> | 2022-12-01 11:35:30 +0100 |
commit | 98d60f61564d067a6e66f1d2e1711fc8e9559865 (patch) | |
tree | 11f0b80e5dd801c8154547c7ab2994d6d8b1e8a2 /examples | |
parent | a6c4d95727b4344ff63858c2aa46a12dbd832c9d (diff) | |
download | qttools-98d60f61564d067a6e66f1d2e1711fc8e9559865.tar.gz |
QDoc: Remove unnecessary variable
`HtmlGenerator::generateAllQmlMembersFile`, the method that produces the
output documentation for the page that lists all documentable elements
that compose a QML type, produces its output by destructuring a certain
structure containing an internal representation of the elements that
will be listed in the produced file.
The structure, which is constructed and provided by `Sections`, an
internal structure that categorizes `Node`s, the base class for the
internal representation that QDoc uses for documentable elements, such
that they are usable to produces certain list of elements, provides the
required elements as a complex nested structure, the leaf part of which
is a pair of "keys" and "values".
When destructuring this complex structure, the method would access the
leaf part of the structure and use both the "keys" and "values" that
composed it.
The "values", which are `Node`s representing the elements of the list to
be produced, are iterated over to produce the output documentation.
The "keys", were used to bound the iteration over the "values", that is,
their size was used as the bounding condition for an arithmetic loop
iterating over the "values".
As the "values" themselves are stored into a vector, their is no need to
use the "keys" to bind the loop, as the size of the "values" vector
itself is sufficient, and more correct, to provide the same binding.
Hence, the usage of "keys" to bind the loop that iterated over the
"values" was removed, as unnecessary.
No behavior change should be produced as a consequence.
Since the "keys" and the "values", which are produced from the keys and
values of an internal `MultiMap` used by `Sections` to produce the above
mentioned "keys" and "values", are expected to generally be the same
size, unless collision were encountered when building the `MultiMap`, in
which case the usage of the "keys"' size would not correctly iterate
over the whole of "values", producing an incomplete documentation.
No such case seems to be present in the current Qt documentation, such
this change is not expected to modify the final state of the output documentation.
Change-Id: I61ce73aa504bdc996abf657c15f399945a44fbc4
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'examples')
0 files changed, 0 insertions, 0 deletions