From b36be591afa841f1cef7bdccb3454bb373ac4822 Mon Sep 17 00:00:00 2001 From: Daniel Parker Date: Mon, 9 Dec 2024 15:25:03 -0500 Subject: [PATCH] Refactor custom functions --- include/jsoncons_ext/jmespath/jmespath.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/jsoncons_ext/jmespath/jmespath.hpp b/include/jsoncons_ext/jmespath/jmespath.hpp index a3877983e..0411be4c0 100644 --- a/include/jsoncons_ext/jmespath/jmespath.hpp +++ b/include/jsoncons_ext/jmespath/jmespath.hpp @@ -242,7 +242,7 @@ namespace jmespath { union { - expression_base_type* expression_; + std::reference_wrapper expression_; pointer value_; }; @@ -270,7 +270,7 @@ namespace jmespath { } parameter(expression_base_type* expression) noexcept - : type_(parameter_kind::expression), expression_(expression) + : type_(parameter_kind::expression), expression_(*expression) { } @@ -311,7 +311,7 @@ namespace jmespath { const expression_base_type& expression() const { - return *expression_; + return expression_; } };