forked from qt-creator/qt-creator
MimeType: Improve performance for matchesName
aliases() iterates through the entire hash. It should not be called so frequently. Change-Id: I2f896489459b2237a0a1763919fb8a52fb411ae1 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
committed by
Eike Ziller
parent
736168497a
commit
7ccab9b540
@@ -432,7 +432,9 @@ QString MimeType::filterString() const
|
||||
|
||||
bool MimeType::matchesName(const QString &nameOrAlias) const
|
||||
{
|
||||
return d->name == nameOrAlias || aliases().contains(nameOrAlias);
|
||||
if (d->name == nameOrAlias)
|
||||
return true;
|
||||
return MimeDatabasePrivate::instance()->provider()->resolveAlias(nameOrAlias) == d->name;
|
||||
}
|
||||
|
||||
void MimeType::setPreferredSuffix(const QString &suffix)
|
||||
|
Reference in New Issue
Block a user