Skip to content

Commit

Permalink
is_subconstraint(): fix the rational case
Browse files Browse the repository at this point in the history
  • Loading branch information
N-Nagorny committed Jul 20, 2022
1 parent 7110652 commit 64f27ec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Development/nmos/constraints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ namespace nmos
const auto& subconstraint_enum_values = nmos::fields::constraint_enum(subconstraint).as_array();
if (subconstraint_enum_values.end() == std::find_if(subconstraint_enum_values.begin(), subconstraint_enum_values.end(), [&constraint](const web::json::value& enum_value)
{
if (enum_value.has_field(nmos::fields::numerator))
{
return details::match_constraint(nmos::parse_rational(enum_value), constraint, [](const web::json::value& v) { return nmos::parse_rational(v); });
}
return details::match_constraint(enum_value, constraint, [](const web::json::value& v) { return v; });
}))
{
Expand Down

0 comments on commit 64f27ec

Please sign in to comment.