From a5262c18e23bbbd45d677226e20ea3952f52bb30 Mon Sep 17 00:00:00 2001 From: Niels Date: Thu, 30 Jun 2016 12:43:06 +0200 Subject: [PATCH] replaced a copy by a move to increase performance by 16-25% --- src/json.hpp | 2 +- src/json.hpp.re2c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/json.hpp b/src/json.hpp index 35bdd293c..d9c75c4a9 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -8480,7 +8480,7 @@ basic_json_parser_63: // return parser result and replace it with null in case the // top-level value was discarded by the callback function - return result.is_discarded() ? basic_json() : result; + return result.is_discarded() ? basic_json() : std::move(result); } private: diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c index 016ff0c51..ba045342e 100644 --- a/src/json.hpp.re2c +++ b/src/json.hpp.re2c @@ -7790,7 +7790,7 @@ class basic_json // return parser result and replace it with null in case the // top-level value was discarded by the callback function - return result.is_discarded() ? basic_json() : result; + return result.is_discarded() ? basic_json() : std::move(result); } private: