Locator: De-duplicate RegExp pattern generation

Change-Id: I3576e1507aebed15245e1f197995bfe9e345e32b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Andre Hartmann
2017-09-28 20:09:27 +02:00
committed by André Hartmann
parent e0639d0696
commit 8730dbd4e6
7 changed files with 14 additions and 13 deletions

View File

@@ -67,9 +67,7 @@ QList<Core::LocatorFilterEntry> CppCurrentDocumentFilter::matchesFor(
QList<Core::LocatorFilterEntry> goodEntries;
QList<Core::LocatorFilterEntry> betterEntries;
const QRegularExpression regexp = containsWildcard(entry)
? createWildcardRegExp(entry) : CamelHumpMatcher::createCamelHumpRegExp(entry);
const QRegularExpression regexp = createRegExp(entry);
if (!regexp.isValid())
return goodEntries;

View File

@@ -76,9 +76,8 @@ QList<Core::LocatorFilterEntry> CppLocatorFilter::matchesFor(
const Qt::CaseSensitivity caseSensitivityForPrefix = caseSensitivity(entry);
bool hasColonColon = entry.contains(QLatin1String("::"));
const IndexItem::ItemType wanted = matchTypes();
const QRegularExpression regexp = containsWildcard(entry)
? createWildcardRegExp(entry) : CamelHumpMatcher::createCamelHumpRegExp(entry);
const QRegularExpression regexp = createRegExp(entry);
if (!regexp.isValid())
return goodEntries;