From 27077339207fbcddcd38a74bb0e9559b8917ada0 Mon Sep 17 00:00:00 2001 From: Niels Date: Thu, 6 Aug 2015 22:53:16 +0200 Subject: [PATCH] fixed off-by-one error --- src/json.hpp | 3 +-- src/json.hpp.re2c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/json.hpp b/src/json.hpp index 79df1f78..d1338969 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -5757,10 +5757,9 @@ class basic_json ++anchor; ++array_index; - first = calculate_key(); - if (array_index < container_size) { + first = calculate_key(); second = *anchor; } diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c index 585aa205..f8547367 100644 --- a/src/json.hpp.re2c +++ b/src/json.hpp.re2c @@ -5757,10 +5757,9 @@ class basic_json ++anchor; ++array_index; - first = calculate_key(); - if (array_index < container_size) { + first = calculate_key(); second = *anchor; }