File tree 3 files changed +6
-15
lines changed
3 files changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -123,11 +123,8 @@ buildMain(const CliArgsView args) {
123
123
auto [ptr, ec] = std::from_chars (
124
124
nextArg.data (), nextArg.data () + nextArg.size (), numThreads
125
125
);
126
- if (ec == std::errc ()) {
127
- setParallelism (numThreads);
128
- } else {
129
- Bail (" invalid number of threads: {}" , nextArg);
130
- }
126
+ Ensure (ec == std::errc (), " invalid number of threads: {}" , nextArg);
127
+ setParallelism (numThreads);
131
128
} else {
132
129
return BUILD_CMD.noSuchArg (arg);
133
130
}
Original file line number Diff line number Diff line change @@ -62,11 +62,8 @@ runMain(const CliArgsView args) {
62
62
auto [ptr, ec] = std::from_chars (
63
63
nextArg.data (), nextArg.data () + nextArg.size (), numThreads
64
64
);
65
- if (ec == std::errc ()) {
66
- setParallelism (numThreads);
67
- } else {
68
- Bail (" invalid number of threads: {}" , nextArg);
69
- }
65
+ Ensure (ec == std::errc (), " invalid number of threads: {}" , nextArg);
66
+ setParallelism (numThreads);
70
67
} else {
71
68
// Unknown argument is the start of the program arguments.
72
69
break ;
Original file line number Diff line number Diff line change @@ -69,11 +69,8 @@ tidyMain(const CliArgsView args) {
69
69
auto [ptr, ec] = std::from_chars (
70
70
nextArg.data (), nextArg.data () + nextArg.size (), numThreads
71
71
);
72
- if (ec == std::errc ()) {
73
- setParallelism (numThreads);
74
- } else {
75
- Bail (" invalid number of threads: {}" , nextArg);
76
- }
72
+ Ensure (ec == std::errc (), " invalid number of threads: {}" , nextArg);
73
+ setParallelism (numThreads);
77
74
} else {
78
75
return TIDY_CMD.noSuchArg (arg);
79
76
}
You can’t perform that action at this time.
0 commit comments