Use QString::compare with Qt::CaseInsensitive to reduce allocations
This commit is contained in:
@@ -126,7 +126,7 @@ void ChartLyricsProvider::HandleSearchReply(QNetworkReply *reply, const quint64
|
||||
}
|
||||
else if (type == QXmlStreamReader::EndElement) {
|
||||
if (name == "GetLyricResult") {
|
||||
if (!result.artist.isEmpty() && !result.title.isEmpty() && !result.lyrics.isEmpty() && (result.artist.toLower() == artist.toLower() || result.title.toLower() == title.toLower())) {
|
||||
if (!result.artist.isEmpty() && !result.title.isEmpty() && !result.lyrics.isEmpty() && (result.artist.compare(artist, Qt::CaseInsensitive) == 0 || result.title.compare(title, Qt::CaseInsensitive) == 0)) {
|
||||
result.lyrics = Utilities::DecodeHtmlEntities(result.lyrics);
|
||||
results << result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user