mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 14:38:04 -06:00
Use numeric_limits instead of constants from C
In C++, using numeric_limits is more idiomatic compared to using constants.
This commit is contained in:
@@ -28,6 +28,8 @@
|
||||
|
||||
#include "searchcontroller.h"
|
||||
|
||||
#include <limits>
|
||||
|
||||
#include <QJsonArray>
|
||||
#include <QJsonObject>
|
||||
#include <QSharedPointer>
|
||||
@@ -293,7 +295,7 @@ int SearchController::generateSearchId() const
|
||||
|
||||
while (true)
|
||||
{
|
||||
const auto id = Utils::Random::rand(1, INT_MAX);
|
||||
const int id = Utils::Random::rand(1, std::numeric_limits<int>::max());
|
||||
if (!searchHandlers.contains(id))
|
||||
return id;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user