Use anonymous namespace for constants
This commit is contained in:
@@ -35,7 +35,9 @@
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
const int LyricsFetcher::kMaxConcurrentRequests = 5;
|
||||
namespace {
|
||||
constexpr int kMaxConcurrentRequests = 5;
|
||||
}
|
||||
|
||||
LyricsFetcher::LyricsFetcher(SharedPtr<LyricsProviders> lyrics_providers, QObject *parent)
|
||||
: QObject(parent),
|
||||
|
||||
@@ -69,8 +69,6 @@ class LyricsFetcher : public QObject {
|
||||
void StartRequests();
|
||||
|
||||
private:
|
||||
static const int kMaxConcurrentRequests;
|
||||
|
||||
SharedPtr<LyricsProviders> lyrics_providers_;
|
||||
quint64 next_id_;
|
||||
|
||||
|
||||
@@ -34,9 +34,11 @@
|
||||
#include "lyricsprovider.h"
|
||||
#include "lyricsproviders.h"
|
||||
|
||||
const int LyricsFetcherSearch::kSearchTimeoutMs = 3000;
|
||||
const int LyricsFetcherSearch::kGoodLyricsLength = 60;
|
||||
const float LyricsFetcherSearch::kHighScore = 2.5;
|
||||
namespace {
|
||||
constexpr int kSearchTimeoutMs = 3000;
|
||||
constexpr int kGoodLyricsLength = 60;
|
||||
constexpr float kHighScore = 2.5;
|
||||
} // namespace
|
||||
|
||||
LyricsFetcherSearch::LyricsFetcherSearch(const quint64 id, const LyricsSearchRequest &request, QObject *parent)
|
||||
: QObject(parent),
|
||||
|
||||
@@ -57,10 +57,6 @@ class LyricsFetcherSearch : public QObject {
|
||||
static bool LyricsSearchResultCompareScore(const LyricsSearchResult &a, const LyricsSearchResult &b);
|
||||
|
||||
private:
|
||||
static const int kSearchTimeoutMs;
|
||||
static const int kGoodLyricsLength;
|
||||
static const float kHighScore;
|
||||
|
||||
quint64 id_;
|
||||
LyricsSearchRequest request_;
|
||||
LyricsSearchResults results_;
|
||||
|
||||
Reference in New Issue
Block a user