diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-06-20 17:28:12 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-06-22 10:43:11 +0000 |
commit | 831a7e06c0f3df5b93ae27e3535fe64188ececb6 (patch) | |
tree | fe5d3f032488afe329d9a1198d0d9c233044b57d /src/tools/qdoc/tree.cpp | |
parent | 792f68adea6abd7e3c947a3a195c737efc36b760 (diff) |
qdoc: don't hold Location in QLists, don't even copy it
Location is a self-referential type that is very expensive to copy.
So don't.
Instead, just remember the iterator, and use value()->location()
(which returns a reference, so doesn't copy).
Change-Id: I9a2b72b05b8051e793cf67179a0195f2f3551a10
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
Diffstat (limited to 'src/tools/qdoc/tree.cpp')
-rw-r--r-- | src/tools/qdoc/tree.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/tools/qdoc/tree.cpp b/src/tools/qdoc/tree.cpp index d55367dce2..6c21d730c1 100644 --- a/src/tools/qdoc/tree.cpp +++ b/src/tools/qdoc/tree.cpp @@ -1142,18 +1142,15 @@ const DocumentNode* Tree::findDocumentNodeByTitle(const QString& title) const DocumentNodeMultiMap::const_iterator j = i; ++j; if (j != docNodesByTitle_.constEnd() && j.key() == i.key()) { - QList<Location> internalLocations; while (j != docNodesByTitle_.constEnd()) { if (j.key() == i.key() && j.value()->url().isEmpty()) { - internalLocations.append(j.value()->location()); break; // Just report one duplicate for now. } ++j; } - if (internalLocations.size() > 0) { + if (j != docNodesByTitle_.cend()) { i.value()->location().warning("This page title exists in more than one file: " + title); - foreach (const Location &location, internalLocations) - location.warning("[It also exists here]"); + j.value()->location().warning("[It also exists here]"); } } return i.value(); |