From 2dd94dd943bedce405c068552a96a03ff1778789 Mon Sep 17 00:00:00 2001 From: Niels Date: Sun, 12 Apr 2015 17:26:54 +0200 Subject: [PATCH] some simplifications --- src/json.hpp | 12 ++++-------- src/json.hpp.re2c | 12 ++++-------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/json.hpp b/src/json.hpp index 12026cb0..89fd9a41 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -1498,9 +1498,7 @@ class basic_json */ inline const_iterator begin() const noexcept { - const_iterator result(this); - result.set_begin(); - return result; + return cbegin(); } /*! @@ -1531,9 +1529,7 @@ class basic_json */ inline const_iterator end() const noexcept { - const_iterator result(this); - result.set_end(); - return result; + return cend(); } /*! @@ -1562,7 +1558,7 @@ class basic_json */ inline const_reverse_iterator rbegin() const noexcept { - return const_reverse_iterator(end()); + return crbegin(); } /*! @@ -1580,7 +1576,7 @@ class basic_json */ inline const_reverse_iterator rend() const noexcept { - return const_reverse_iterator(begin()); + return crend(); } /*! diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c index 738295a0..d2414298 100644 --- a/src/json.hpp.re2c +++ b/src/json.hpp.re2c @@ -1498,9 +1498,7 @@ class basic_json */ inline const_iterator begin() const noexcept { - const_iterator result(this); - result.set_begin(); - return result; + return cbegin(); } /*! @@ -1531,9 +1529,7 @@ class basic_json */ inline const_iterator end() const noexcept { - const_iterator result(this); - result.set_end(); - return result; + return cend(); } /*! @@ -1562,7 +1558,7 @@ class basic_json */ inline const_reverse_iterator rbegin() const noexcept { - return const_reverse_iterator(end()); + return crbegin(); } /*! @@ -1580,7 +1576,7 @@ class basic_json */ inline const_reverse_iterator rend() const noexcept { - return const_reverse_iterator(begin()); + return crend(); } /*!