From 2e4d4939260a3768cfa32a6102dff96c4f827c03 Mon Sep 17 00:00:00 2001 From: "Cameron T. Druyor" Date: Sat, 30 Apr 2016 13:44:36 -0400 Subject: [PATCH] refactored into one line to satisfy lcov --- src/json.hpp | 5 +---- src/json.hpp.re2c | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/json.hpp b/src/json.hpp index ed96c49b4..72e9ef065 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -6267,10 +6267,7 @@ class basic_json // remove '+' sign from the exponent if necessary if (not m_type.bits.exp_plus) { - if (len > static_cast(sizeof(buf))) - { - len = sizeof(buf); - } + len = std::min(len, static_cast(sizeof(buf))); for (int i = 0; i < len; i++) { if (buf[i] == '+') diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c index 1a986f1ad..5fc8c0413 100644 --- a/src/json.hpp.re2c +++ b/src/json.hpp.re2c @@ -6267,10 +6267,7 @@ class basic_json // remove '+' sign from the exponent if necessary if (not m_type.bits.exp_plus) { - if (len > static_cast(sizeof(buf))) - { - len = sizeof(buf); - } + len = std::min(len, static_cast(sizeof(buf))); for (int i = 0; i < len; i++) { if (buf[i] == '+')