mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 16:23:07 -07: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:
parent
edef85fa3e
commit
0e421ae415
2 changed files with 3 additions and 3 deletions
|
@ -401,7 +401,7 @@ void Application::processParams(const QStringList ¶ms)
|
|||
}
|
||||
|
||||
if (param.startsWith(QLatin1String("@addPaused="))) {
|
||||
torrentParams.addPaused = param.mid(11).toInt() ? TriStateBool::True : TriStateBool::False;
|
||||
torrentParams.addPaused = param.midRef(11).toInt() ? TriStateBool::True : TriStateBool::False;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -426,7 +426,7 @@ void Application::processParams(const QStringList ¶ms)
|
|||
}
|
||||
|
||||
if (param.startsWith(QLatin1String("@skipDialog="))) {
|
||||
skipTorrentDialog = param.mid(12).toInt() ? TriStateBool::True : TriStateBool::False;
|
||||
skipTorrentDialog = param.midRef(12).toInt() ? TriStateBool::True : TriStateBool::False;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue