From f1cd15ce7e66518007101e73bb91c87b27c13512 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sun, 26 Feb 2017 11:22:18 +0100 Subject: [PATCH] :zap: avoid copying a string --- 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 6dfc1831..6be0a2bf 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -12477,7 +12477,7 @@ basic_json_parser_74: // the valid JSON Patch operations enum class patch_operations {add, remove, replace, move, copy, test, invalid}; - const auto get_op = [](const std::string op) + const auto get_op = [](const std::string & op) { if (op == "add") { diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c index a42daba6..0d6e9dab 100644 --- a/src/json.hpp.re2c +++ b/src/json.hpp.re2c @@ -11511,7 +11511,7 @@ class basic_json // the valid JSON Patch operations enum class patch_operations {add, remove, replace, move, copy, test, invalid}; - const auto get_op = [](const std::string op) + const auto get_op = [](const std::string & op) { if (op == "add") {