diff --git a/C++/main.cpp b/C++/main.cpp
@@ -38,21 +38,16 @@ void get_counterexpl_thread(unsigned int start, unsigned int max, unsigned int i
bool read_first_arg(int argc, char *argv[], unsigned int *value)
{
- if (argc > 1)
+ try
{
std::string value_str = argv[1];
-
- try
- {
- *value = std::stoul(value_str);
- return true;
- }
- catch (...)
- {
- return false;
- }
+ *value = std::stoul(value_str);
+ return true;
+ }
+ catch (...)
+ {
+ return false;
}
- else return false;
}
int main(int argc, char *argv[])
@@ -76,8 +71,5 @@ int main(int argc, char *argv[])
return SUCCESS;
}
- else
- {
- return INVALID_INPUT;
- }
+ else return INVALID_INPUT;
}
\ No newline at end of file