diff --git a/README.md b/README.md index a4111e16e..3a8059d3e 100644 --- a/README.md +++ b/README.md @@ -382,6 +382,7 @@ I deeply appreciate the help of the following people. - [Joshua C. Randall](https://github.com/jrandall) fixed a bug in the floating-point serialization. - [Aaron Burghardt](https://github.com/aburgh) implemented code to parse streams incrementally. - [Daniel Kopeček](https://github.com/dkopecek) fixed a bug in the compilation with GCC 5.0. +- [Florian Weber](https://github.com/Florianjw) fixed a bug in and improved the performance of the comparison operators. Thanks a lot for helping out! @@ -394,7 +395,7 @@ $ make $ ./json_unit =============================================================================== -All tests passed (4463 assertions in 18 test cases) +All tests passed (4558 assertions in 19 test cases) ``` For more information, have a look at the file [.travis.yml](https://github.com/nlohmann/json/blob/master/.travis.yml). diff --git a/src/json.hpp b/src/json.hpp index c4f9e8782..cb98b5af1 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -1812,6 +1812,7 @@ class basic_json { const auto lhs_type = lhs.type(); const auto rhs_type = rhs.type(); + if (lhs_type == rhs_type) { switch (lhs_type) @@ -1859,6 +1860,7 @@ class basic_json { const auto lhs_type = lhs.type(); const auto rhs_type = rhs.type(); + if (lhs_type == rhs_type) { switch (lhs_type) diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c index 94a6723bc..f302c7d53 100644 --- a/src/json.hpp.re2c +++ b/src/json.hpp.re2c @@ -1812,6 +1812,7 @@ class basic_json { const auto lhs_type = lhs.type(); const auto rhs_type = rhs.type(); + if (lhs_type == rhs_type) { switch (lhs_type) @@ -1859,6 +1860,7 @@ class basic_json { const auto lhs_type = lhs.type(); const auto rhs_type = rhs.type(); + if (lhs_type == rhs_type) { switch (lhs_type)