Clang-Tidy and Clazy fixes
This commit is contained in:
@@ -185,6 +185,7 @@ void AcoustidClient::RequestFinished(QNetworkReply *reply, const int request_id)
|
||||
std::stable_sort(id_source_list.begin(), id_source_list.end());
|
||||
|
||||
QList<QString> id_list;
|
||||
id_list.reserve(id_source_list.count());
|
||||
for (const IdSource &is : id_source_list) {
|
||||
id_list << is.id_;
|
||||
}
|
||||
|
||||
@@ -433,6 +433,7 @@ MusicBrainzClient::ResultList MusicBrainzClient::ParseTrack(QXmlStreamReader *re
|
||||
}
|
||||
else {
|
||||
std::stable_sort(releases.begin(), releases.end());
|
||||
ret.reserve(releases.count());
|
||||
for (const Release &release : releases) {
|
||||
ret << release.CopyAndMergeInto(result);
|
||||
}
|
||||
@@ -523,7 +524,7 @@ MusicBrainzClient::ResultList MusicBrainzClient::UniqueResults(const ResultList
|
||||
|
||||
}
|
||||
|
||||
void MusicBrainzClient::Error(const QString &error, QVariant debug) {
|
||||
void MusicBrainzClient::Error(const QString &error, const QVariant &debug) {
|
||||
|
||||
qLog(Error) << "MusicBrainz:" << error;
|
||||
if (debug.isValid()) qLog(Debug) << debug;
|
||||
|
||||
@@ -197,7 +197,7 @@ class MusicBrainzClient : public QObject {
|
||||
static void ParseArtist(QXmlStreamReader *reader, QString *artist);
|
||||
static Release ParseRelease(QXmlStreamReader *reader);
|
||||
static ResultList UniqueResults(const ResultList &results, UniqueResultsSortOption opt = SortResults);
|
||||
void Error(const QString &error, QVariant debug = QVariant());
|
||||
void Error(const QString &error, const QVariant &debug = QVariant());
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ void TagFetcher::TagsFetched(const int index, const MusicBrainzClient::ResultLis
|
||||
|
||||
const Song &original_song = songs_[index];
|
||||
SongList songs_guessed;
|
||||
|
||||
songs_guessed.reserve(results.count());
|
||||
for (const MusicBrainzClient::Result &result : results) {
|
||||
Song song;
|
||||
song.Init(result.title_, result.artist_, result.album_, result.duration_msec_ * kNsecPerMsec);
|
||||
|
||||
Reference in New Issue
Block a user