mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 15:07:22 -06:00
Don't create temporary substrings
Avoid temporary string allocations. They are only used to convert to something else. QString::xxxRef() returns a QStringRef. QStringRef avoids the memory allocation and reference counting overhead of a standard QString by simply referencing a part of the original string.
This commit is contained in:
@@ -302,7 +302,7 @@ bool AutoDownloadRule::matches(const QString &articleTitle) const
|
||||
QRegularExpression reg(cachedRegex(partialPattern1));
|
||||
|
||||
if (ep.endsWith('-')) { // Infinite range
|
||||
int epOurs = ep.left(ep.size() - 1).toInt();
|
||||
int epOurs = ep.leftRef(ep.size() - 1).toInt();
|
||||
|
||||
// Extract partial match from article and compare as digits
|
||||
matcher = reg.match(articleTitle);
|
||||
|
||||
Reference in New Issue
Block a user