mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 22:47:21 -06:00
Improve performance of checking path extension
This commit is contained in:
@@ -155,7 +155,9 @@ QString Path::extension() const
|
||||
|
||||
bool Path::hasExtension(const QString &ext) const
|
||||
{
|
||||
return (extension().compare(ext, Qt::CaseInsensitive) == 0);
|
||||
Q_ASSERT(ext.startsWith(QLatin1Char('.')));
|
||||
|
||||
return m_pathStr.endsWith(ext, Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
bool Path::hasAncestor(const Path &other) const
|
||||
|
||||
Reference in New Issue
Block a user