remove braces around single-return-statement switch-cases

This commit is contained in:
Florian Weber 2015-04-26 14:44:56 +02:00
parent d2771eb1bb
commit f5e95522aa
2 changed files with 0 additions and 56 deletions

View file

@ -1875,35 +1875,21 @@ class basic_json
switch (lhs_type) switch (lhs_type)
{ {
case (value_t::array): case (value_t::array):
{
return *lhs.m_value.array == *rhs.m_value.array; return *lhs.m_value.array == *rhs.m_value.array;
}
case (value_t::object): case (value_t::object):
{
return *lhs.m_value.object == *rhs.m_value.object; return *lhs.m_value.object == *rhs.m_value.object;
}
case (value_t::null): case (value_t::null):
{
return true; return true;
}
case (value_t::string): case (value_t::string):
{
return *lhs.m_value.string == *rhs.m_value.string; return *lhs.m_value.string == *rhs.m_value.string;
}
case (value_t::boolean): case (value_t::boolean):
{
return lhs.m_value.boolean == rhs.m_value.boolean; return lhs.m_value.boolean == rhs.m_value.boolean;
}
case (value_t::number_integer): case (value_t::number_integer):
{
return lhs.m_value.number_integer == rhs.m_value.number_integer; return lhs.m_value.number_integer == rhs.m_value.number_integer;
}
case (value_t::number_float): case (value_t::number_float):
{
return approx(lhs.m_value.number_float, rhs.m_value.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) 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), return approx(static_cast<number_float_t>(lhs.m_value.number_integer),
@ -1936,35 +1922,21 @@ class basic_json
switch (lhs_type) switch (lhs_type)
{ {
case (value_t::array): case (value_t::array):
{
return *lhs.m_value.array < *rhs.m_value.array; return *lhs.m_value.array < *rhs.m_value.array;
}
case (value_t::object): case (value_t::object):
{
return *lhs.m_value.object < *rhs.m_value.object; return *lhs.m_value.object < *rhs.m_value.object;
}
case (value_t::null): case (value_t::null):
{
return false; return false;
}
case (value_t::string): case (value_t::string):
{
return *lhs.m_value.string < *rhs.m_value.string; return *lhs.m_value.string < *rhs.m_value.string;
}
case (value_t::boolean): case (value_t::boolean):
{
return lhs.m_value.boolean < rhs.m_value.boolean; return lhs.m_value.boolean < rhs.m_value.boolean;
}
case (value_t::number_integer): case (value_t::number_integer):
{
return lhs.m_value.number_integer < rhs.m_value.number_integer; return lhs.m_value.number_integer < rhs.m_value.number_integer;
}
case (value_t::number_float): case (value_t::number_float):
{
return lhs.m_value.number_float < rhs.m_value.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) 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) < return static_cast<number_float_t>(lhs.m_value.number_integer) <

View file

@ -1875,35 +1875,21 @@ class basic_json
switch (lhs_type) switch (lhs_type)
{ {
case (value_t::array): case (value_t::array):
{
return *lhs.m_value.array == *rhs.m_value.array; return *lhs.m_value.array == *rhs.m_value.array;
}
case (value_t::object): case (value_t::object):
{
return *lhs.m_value.object == *rhs.m_value.object; return *lhs.m_value.object == *rhs.m_value.object;
}
case (value_t::null): case (value_t::null):
{
return true; return true;
}
case (value_t::string): case (value_t::string):
{
return *lhs.m_value.string == *rhs.m_value.string; return *lhs.m_value.string == *rhs.m_value.string;
}
case (value_t::boolean): case (value_t::boolean):
{
return lhs.m_value.boolean == rhs.m_value.boolean; return lhs.m_value.boolean == rhs.m_value.boolean;
}
case (value_t::number_integer): case (value_t::number_integer):
{
return lhs.m_value.number_integer == rhs.m_value.number_integer; return lhs.m_value.number_integer == rhs.m_value.number_integer;
}
case (value_t::number_float): case (value_t::number_float):
{
return approx(lhs.m_value.number_float, rhs.m_value.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) 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), return approx(static_cast<number_float_t>(lhs.m_value.number_integer),
@ -1936,35 +1922,21 @@ class basic_json
switch (lhs_type) switch (lhs_type)
{ {
case (value_t::array): case (value_t::array):
{
return *lhs.m_value.array < *rhs.m_value.array; return *lhs.m_value.array < *rhs.m_value.array;
}
case (value_t::object): case (value_t::object):
{
return *lhs.m_value.object < *rhs.m_value.object; return *lhs.m_value.object < *rhs.m_value.object;
}
case (value_t::null): case (value_t::null):
{
return false; return false;
}
case (value_t::string): case (value_t::string):
{
return *lhs.m_value.string < *rhs.m_value.string; return *lhs.m_value.string < *rhs.m_value.string;
}
case (value_t::boolean): case (value_t::boolean):
{
return lhs.m_value.boolean < rhs.m_value.boolean; return lhs.m_value.boolean < rhs.m_value.boolean;
}
case (value_t::number_integer): case (value_t::number_integer):
{
return lhs.m_value.number_integer < rhs.m_value.number_integer; return lhs.m_value.number_integer < rhs.m_value.number_integer;
}
case (value_t::number_float): case (value_t::number_float):
{
return lhs.m_value.number_float < rhs.m_value.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) 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) < return static_cast<number_float_t>(lhs.m_value.number_integer) <