mapleFU commented on code in PR #1856:
URL: https://github.com/apache/kvrocks/pull/1856#discussion_r1371481611
##########
src/types/json.h:
##########
@@ -198,6 +198,23 @@ struct JsonValue {
return count;
}
+ Status ArrLen(std::string_view path, std::vector<uint64_t> &arr_lens) const {
+ try {
+ jsoncons::jsonpath::json_query(value, path,
+ [&arr_lens](const std::string & /*path*/,
const jsoncons::json &basic_json) {
+ if (basic_json.is_array()) {
+
arr_lens.push_back(static_cast<int64_t>(basic_json.size()));
+ } else {
+ arr_lens.push_back(-1);
Review Comment:
Hmmmmm it's underflow?
##########
src/types/json.h:
##########
@@ -198,6 +198,23 @@ struct JsonValue {
return count;
}
+ Status ArrLen(std::string_view path, std::vector<uint64_t> &arr_lens) const {
+ try {
+ jsoncons::jsonpath::json_query(value, path,
+ [&arr_lens](const std::string & /*path*/,
const jsoncons::json &basic_json) {
+ if (basic_json.is_array()) {
+
arr_lens.push_back(static_cast<int64_t>(basic_json.size()));
Review Comment:
Why a uint64_t array push_back a int64_t here lol
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]