We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7b18d86 + 664dc4c commit 409da26Copy full SHA for 409da26
src/Main.cpp
@@ -7,10 +7,6 @@
7
#include <iterator>
8
9
namespace {
10
- int Clamp(int upper, int lower, int value) {
11
- return std::max(lower, std::min(upper, value));
12
- }
13
-
14
int run(long argc, const char* argv[]) {
15
ArgumentParser ap(argc, argv);
16
@@ -19,7 +15,7 @@ namespace {
19
20
if (!ap.is("--help") && argc > 2) {
21
17
auto minBlockSize = ap.getInt("-ml", MIN_BLOCK_SIZE);
22
- auto blockPercentThresholdValue = Clamp(100, 0, ap.getInt("-pt", 100));
18
+ auto blockPercentThresholdValue = std::clamp(ap.getInt("-pt", 100), 0, 100);
23
if (blockPercentThresholdValue < 0 || 100 < blockPercentThresholdValue) {
24
throw std::runtime_error("-pt out of range");
25
}
0 commit comments