mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07: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:
parent
75c80c3716
commit
0b1b3c1f84
4 changed files with 8 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue