Skip to content

Commit

Permalink
🚨 Write less type-safe code to make Clang-Tidy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
wlambooy committed Oct 10, 2024
1 parent 8b2bec0 commit 2a94c28
Showing 1 changed file with 17 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,39 +90,29 @@ template <typename EngineType>
std::is_same_v<EngineType, heuristic_sidb_simulation_engine>,
"EngineType must be a SiDB simulation engine type");

if constexpr (std::is_same_v<EngineType, sidb_simulation_engine> ||
std::is_same_v<EngineType, exact_sidb_simulation_engine>)
switch (engine)
{
switch (engine)
case EngineType::EXGS:
{
case EngineType::EXGS:
{
return "ExGS";
}
case EngineType::QUICKEXACT:
{
return "QuickExact";
}
case EngineType::CLUSTERCOMPLETE:
{
return "ClusterComplete";
}
return "ExGS";
}
}

if constexpr (std::is_same_v<EngineType, sidb_simulation_engine> ||
std::is_same_v<EngineType, heuristic_sidb_simulation_engine>)
{
switch (engine)
case EngineType::QUICKEXACT:
{
return "QuickExact";
}
case EngineType::CLUSTERCOMPLETE:
{
case EngineType::QUICKSIM:
{
return "QuickSim";
}
return "ClusterComplete";
}
case EngineType::QUICKSIM:
{
return "QuickSim";
}
default:
{
return "unsupported simulation engine";
}
}

return "unsupported simulation engine";
}

/**
Expand Down

0 comments on commit 2a94c28

Please sign in to comment.