Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Aug 14, 2024
2 parents d5e5533 + 85b284f commit f9658af
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/jsoncons/basic_json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2644,8 +2644,8 @@ namespace jsoncons {
default:
if (is_string_storage(rhs.storage_kind()))
{
double val1 = as<double>();
double val2 = rhs.as<double>();
double val1 = as_double();
double val2 = rhs.as_double();
auto r = val1 - val2;
return r == 0 ? 0 : (r < 0.0 ? -1 : 1);
}
Expand All @@ -2659,7 +2659,7 @@ namespace jsoncons {
case json_storage_kind::long_str:
if (is_number_tag(tag()))
{
double val1 = as<double>();
double val1 = as_double();
switch (rhs.storage_kind())
{
case json_storage_kind::int64:
Expand All @@ -2682,7 +2682,7 @@ namespace jsoncons {
default:
if (is_string_storage(rhs.storage_kind()))
{
double val2 = rhs.as<double>();
double val2 = rhs.as_double();
auto r = val1 - val2;
return r == 0 ? 0 : (r < 0.0 ? -1 : 1);
}
Expand Down Expand Up @@ -2712,7 +2712,7 @@ namespace jsoncons {
}

// compare big numbers as double
auto r = as<double>() - rhs.as<double>();
auto r = as_double() - rhs.as_double();
return r == 0 ? 0 : (r < 0.0 ? -1 : 1);
}
default:
Expand Down

0 comments on commit f9658af

Please sign in to comment.