summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_delegate_qt.cpp
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2016-02-06 12:57:02 +0100
committerPeter Varga <pvarga@inf.u-szeged.hu>2016-02-09 07:54:59 +0000
commit8e5ac243ac774209b77bec42eda2ec43f9c9b04a (patch)
treef9df4f13666b725ecde8f91a24f6b6e1de3998eb /src/core/web_contents_delegate_qt.cpp
parent682deb2588626ba6bf492476684518fd588aeecb (diff)
Optimize FaviconManager related iterations
- Replace foreach with for - Fix expensive iteration over QMap::keys() and QMap::values() Change-Id: Ia7f6803af7f5e609ec57bc4115bec17f43668937 Reviewed-by: Anton Kudryavtsev <a.kudryavtsev@netris.ru> Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com>
Diffstat (limited to 'src/core/web_contents_delegate_qt.cpp')
-rw-r--r--src/core/web_contents_delegate_qt.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index 43ecbdf7f..1dbb38e97 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -249,7 +249,8 @@ void WebContentsDelegateQt::DidFinishLoad(content::RenderFrameHost* render_frame
void WebContentsDelegateQt::DidUpdateFaviconURL(const std::vector<content::FaviconURL> &candidates)
{
QList<FaviconInfo> faviconCandidates;
- Q_FOREACH (content::FaviconURL candidate, candidates) {
+ faviconCandidates.reserve(static_cast<int>(candidates.size()));
+ for (const content::FaviconURL &candidate : candidates) {
// Store invalid candidates too for later debugging via API
faviconCandidates.append(toFaviconInfo(candidate));
}