mapleFU commented on code in PR #1840:
URL: https://github.com/apache/kvrocks/pull/1840#discussion_r1367198017


##########
src/commands/cmd_json.cc:
##########
@@ -40,16 +43,57 @@ class CommandJsonSet : public Commander {
 
 class CommandJsonGet : public Commander {
  public:
+  Status Parse(const std::vector<std::string> &args) override {
+    CommandParser parser(args, 2);
+
+    while (parser.Good()) {
+      if (parser.EatEqICase("INDENT")) {
+        auto indent = GET_OR_RET(parser.TakeStr());
+
+        if (std::any_of(indent.begin(), indent.end(), [](char v) { return v != 
' '; })) {

Review Comment:
   Won't `std::all_of` be more clear here?



##########
src/types/json.h:
##########
@@ -22,35 +22,76 @@
 
 #include <jsoncons/json.hpp>
 #include <jsoncons/json_error.hpp>
+#include <jsoncons/json_options.hpp>
 #include <jsoncons_ext/jsonpath/json_query.hpp>
+#include <jsoncons_ext/jsonpath/jsonpath_error.hpp>
+#include <limits>
 
-#include "jsoncons_ext/jsonpath/jsonpath_error.hpp"
 #include "status.h"
 
 struct JsonValue {
   JsonValue() = default;
   explicit JsonValue(jsoncons::basic_json<char> value) : 
value(std::move(value)) {}
 
-  static StatusOr<JsonValue> FromString(std::string_view str) {
+  static StatusOr<JsonValue> FromString(std::string_view str, int 
max_nesting_depth = std::numeric_limits<int>::max()) {

Review Comment:
   Should we add a constexpr rather than direct using 
`std::numeric_limits<int>::max()`? Since it's difference from default 1024?



-- 
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]

Reply via email to