mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 14:08:03 -06:00
Use slice method where applicable
These code segments already have its boundary checked and can thus be faster. PR #22411.
This commit is contained in:
@@ -1859,10 +1859,10 @@ void OptionsDialog::setLocale(const QString &localeStr)
|
||||
if (index < 0)
|
||||
{
|
||||
//Attempt to find a language match without a country
|
||||
int pos = name.indexOf(u'_');
|
||||
const int pos = name.indexOf(u'_');
|
||||
if (pos > -1)
|
||||
{
|
||||
QString lang = name.left(pos);
|
||||
const QString lang = name.first(pos);
|
||||
index = m_ui->comboLanguage->findData(lang, Qt::UserRole);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user