Commit 7ccab9b5 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Eike Ziller

MimeType: Improve performance for matchesName

aliases() iterates through the entire hash. It should not be called so
frequently.

Change-Id: I2f896489459b2237a0a1763919fb8a52fb411ae1
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent 73616849
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment