From e38463af1f86166a64543ff21f0ed82e598ea1fc Mon Sep 17 00:00:00 2001 From: ChenYaoGang Date: Tue, 26 Nov 2024 23:21:24 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"fix=EF=BC=9AWhen=20there=20are=20elem?= =?UTF-8?q?ents=20and=20the=20sum=20is=20indeed=20zero,=20there=20should?= =?UTF-8?q?=20be=20an=20average=20value=20returned=20instead=20of=20a=20nu?= =?UTF-8?q?ll=20value."?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 01d09de319f160f448ba4b211f2865d366509f16. --- include/jsoncons_ext/jmespath/jmespath.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/jsoncons_ext/jmespath/jmespath.hpp b/include/jsoncons_ext/jmespath/jmespath.hpp index 419fbda9b..61f042928 100644 --- a/include/jsoncons_ext/jmespath/jmespath.hpp +++ b/include/jsoncons_ext/jmespath/jmespath.hpp @@ -790,7 +790,7 @@ namespace jmespath { sum += j.template as(); } - return arg0.size() == 0 ? resources.null_value() : *resources.create_json(sum / arg0.size()); + return sum == 0 ? resources.null_value() : *resources.create_json(sum/arg0.size()); } };