Utils: Purge asConst

Replace by qAsConst.

Change-Id: I3301366f73c066c86f08df7188d70dc3b613c55c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Orgad Shaneh
2018-04-08 23:40:00 +03:00
committed by Orgad Shaneh
parent 11336fb604
commit 7d3a79c696
53 changed files with 65 additions and 163 deletions

View File

@@ -33,7 +33,6 @@
#include <coreplugin/helpmanager.h>
#include <extensionsystem/pluginmanager.h>
#include <utils/algorithm.h>
#include <utils/asconst.h>
#include <utils/utilsicons.h>
#include <QIcon>
@@ -86,7 +85,7 @@ QList<LocatorFilterEntry> HelpIndexFilter::matchesFor(QFutureInterface<LocatorFi
|| !entry.contains(m_searchTermCache)) {
int limit = entry.size() < 2 ? 200 : INT_MAX;
QSet<QString> results;
for (const QString &filePath : Utils::asConst(m_helpDatabases)) {
for (const QString &filePath : qAsConst(m_helpDatabases)) {
if (future.isCanceled())
return QList<LocatorFilterEntry>();
QSet<QString> result;
@@ -111,7 +110,7 @@ QList<LocatorFilterEntry> HelpIndexFilter::matchesFor(QFutureInterface<LocatorFi
keywords.reserve(m_keywordCache.size());
unsortedKeywords.reserve(m_keywordCache.size());
QSet<QString> allresults;
for (const QString &keyword : Utils::asConst(m_keywordCache)) {
for (const QString &keyword : qAsConst(m_keywordCache)) {
if (future.isCanceled())
return QList<LocatorFilterEntry>();
if (keyword.startsWith(entry, cs)) {
@@ -126,7 +125,7 @@ QList<LocatorFilterEntry> HelpIndexFilter::matchesFor(QFutureInterface<LocatorFi
keywords << unsortedKeywords;
m_keywordCache = allresults;
m_searchTermCache = entry;
for (const QString &keyword : Utils::asConst(keywords)) {
for (const QString &keyword : qAsConst(keywords)) {
const int index = keyword.indexOf(entry, 0, cs);
LocatorFilterEntry filterEntry(this, keyword, QVariant(), m_icon);
filterEntry.highlightInfo = {index, entry.length()};