Replace min, max, clamp functions with std counterparts

This commit is contained in:
Chocobo1 2021-12-27 20:31:57 +08:00
parent 3ea4c66d41
commit 63043b4927
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
7 changed files with 36 additions and 28 deletions

View file

@ -28,6 +28,8 @@
#include "addnewtorrentdialog.h"
#include <algorithm>
#include <QDebug>
#include <QDir>
#include <QFileDialog>
@ -231,7 +233,7 @@ int AddNewTorrentDialog::savePathHistoryLength()
{
const int defaultHistoryLength = 8;
const int value = settings()->loadValue(KEY_SAVEPATHHISTORYLENGTH, defaultHistoryLength);
return qBound(minPathHistoryLength, value, maxPathHistoryLength);
return std::clamp(value, minPathHistoryLength, maxPathHistoryLength);
}
void AddNewTorrentDialog::setSavePathHistoryLength(const int value)