Skip to content

Commit

Permalink
Revert "fix:When there are elements and the sum is indeed zero, there…
Browse files Browse the repository at this point in the history
… should be an average value returned instead of a null value."

This reverts commit 01d09de.
  • Loading branch information
Uniplore-X committed Nov 26, 2024
1 parent 0d6eb6a commit e38463a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/jsoncons_ext/jmespath/jmespath.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ namespace jmespath {
sum += j.template as<double>();
}

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());
}
};

Expand Down

0 comments on commit e38463a

Please sign in to comment.