remove braces around single-return-statement switch-cases
This commit is contained in:
parent
d2771eb1bb
commit
f5e95522aa
2 changed files with 0 additions and 56 deletions
28
src/json.hpp
28
src/json.hpp
|
@ -1875,35 +1875,21 @@ class basic_json
|
|||
switch (lhs_type)
|
||||
{
|
||||
case (value_t::array):
|
||||
{
|
||||
return *lhs.m_value.array == *rhs.m_value.array;
|
||||
}
|
||||
case (value_t::object):
|
||||
{
|
||||
return *lhs.m_value.object == *rhs.m_value.object;
|
||||
}
|
||||
case (value_t::null):
|
||||
{
|
||||
return true;
|
||||
}
|
||||
case (value_t::string):
|
||||
{
|
||||
return *lhs.m_value.string == *rhs.m_value.string;
|
||||
}
|
||||
case (value_t::boolean):
|
||||
{
|
||||
return lhs.m_value.boolean == rhs.m_value.boolean;
|
||||
}
|
||||
case (value_t::number_integer):
|
||||
{
|
||||
return lhs.m_value.number_integer == rhs.m_value.number_integer;
|
||||
}
|
||||
case (value_t::number_float):
|
||||
{
|
||||
return approx(lhs.m_value.number_float, rhs.m_value.number_float);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (lhs_type == value_t::number_integer and rhs_type == value_t::number_float)
|
||||
{
|
||||
return approx(static_cast<number_float_t>(lhs.m_value.number_integer),
|
||||
|
@ -1936,35 +1922,21 @@ class basic_json
|
|||
switch (lhs_type)
|
||||
{
|
||||
case (value_t::array):
|
||||
{
|
||||
return *lhs.m_value.array < *rhs.m_value.array;
|
||||
}
|
||||
case (value_t::object):
|
||||
{
|
||||
return *lhs.m_value.object < *rhs.m_value.object;
|
||||
}
|
||||
case (value_t::null):
|
||||
{
|
||||
return false;
|
||||
}
|
||||
case (value_t::string):
|
||||
{
|
||||
return *lhs.m_value.string < *rhs.m_value.string;
|
||||
}
|
||||
case (value_t::boolean):
|
||||
{
|
||||
return lhs.m_value.boolean < rhs.m_value.boolean;
|
||||
}
|
||||
case (value_t::number_integer):
|
||||
{
|
||||
return lhs.m_value.number_integer < rhs.m_value.number_integer;
|
||||
}
|
||||
case (value_t::number_float):
|
||||
{
|
||||
return lhs.m_value.number_float < rhs.m_value.number_float;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (lhs_type == value_t::number_integer and rhs_type == value_t::number_float)
|
||||
{
|
||||
return static_cast<number_float_t>(lhs.m_value.number_integer) <
|
||||
|
|
|
@ -1875,35 +1875,21 @@ class basic_json
|
|||
switch (lhs_type)
|
||||
{
|
||||
case (value_t::array):
|
||||
{
|
||||
return *lhs.m_value.array == *rhs.m_value.array;
|
||||
}
|
||||
case (value_t::object):
|
||||
{
|
||||
return *lhs.m_value.object == *rhs.m_value.object;
|
||||
}
|
||||
case (value_t::null):
|
||||
{
|
||||
return true;
|
||||
}
|
||||
case (value_t::string):
|
||||
{
|
||||
return *lhs.m_value.string == *rhs.m_value.string;
|
||||
}
|
||||
case (value_t::boolean):
|
||||
{
|
||||
return lhs.m_value.boolean == rhs.m_value.boolean;
|
||||
}
|
||||
case (value_t::number_integer):
|
||||
{
|
||||
return lhs.m_value.number_integer == rhs.m_value.number_integer;
|
||||
}
|
||||
case (value_t::number_float):
|
||||
{
|
||||
return approx(lhs.m_value.number_float, rhs.m_value.number_float);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (lhs_type == value_t::number_integer and rhs_type == value_t::number_float)
|
||||
{
|
||||
return approx(static_cast<number_float_t>(lhs.m_value.number_integer),
|
||||
|
@ -1936,35 +1922,21 @@ class basic_json
|
|||
switch (lhs_type)
|
||||
{
|
||||
case (value_t::array):
|
||||
{
|
||||
return *lhs.m_value.array < *rhs.m_value.array;
|
||||
}
|
||||
case (value_t::object):
|
||||
{
|
||||
return *lhs.m_value.object < *rhs.m_value.object;
|
||||
}
|
||||
case (value_t::null):
|
||||
{
|
||||
return false;
|
||||
}
|
||||
case (value_t::string):
|
||||
{
|
||||
return *lhs.m_value.string < *rhs.m_value.string;
|
||||
}
|
||||
case (value_t::boolean):
|
||||
{
|
||||
return lhs.m_value.boolean < rhs.m_value.boolean;
|
||||
}
|
||||
case (value_t::number_integer):
|
||||
{
|
||||
return lhs.m_value.number_integer < rhs.m_value.number_integer;
|
||||
}
|
||||
case (value_t::number_float):
|
||||
{
|
||||
return lhs.m_value.number_float < rhs.m_value.number_float;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (lhs_type == value_t::number_integer and rhs_type == value_t::number_float)
|
||||
{
|
||||
return static_cast<number_float_t>(lhs.m_value.number_integer) <
|
||||
|
|
Loading…
Reference in a new issue