Commit 5f42af1d authored by nagayama15's avatar nagayama15

リファクタリング

parent e24262a4
...@@ -21,19 +21,17 @@ namespace ...@@ -21,19 +21,17 @@ namespace
{ {
try try
{ {
if constexpr (std::is_unsigned_v<Integer>) const auto v = [](llvm::StringRef s)
{ {
const auto v = std::stoull(arg.str()); if constexpr (std::is_unsigned_v<Integer>)
if (Min <= v && v <= Max)
{ {
val = static_cast<Integer>(v); return std::stoull(s.str());
return false;
}
} }
else else
{ {
const auto v = std::stoll(arg.str()); return std::stoll(s.str());
}
}(arg);
if (Min <= v && v <= Max) if (Min <= v && v <= Max)
{ {
...@@ -41,7 +39,6 @@ namespace ...@@ -41,7 +39,6 @@ namespace
return false; return false;
} }
} }
}
catch ([[maybe_unused]] const std::exception& e) catch ([[maybe_unused]] const std::exception& e)
{ {
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment