pitrou commented on code in PR #51038:
URL: https://github.com/apache/arrow/pull/51038#discussion_r4131050351


##########
cpp/src/arrow/util/simdjson_internal.cc:
##########
@@ -581,4 +581,18 @@ Status ValidateJsonDocument(simdjson::ondemand::parser& 
parser,
   return ConsumeJsonValue(value);
 }
 
+/// Returns the number of leading whitespace characters when trailing is false,
+/// or the number of trailing whitespace characters when trailing is true.
+// XXX We could try to SIMD-accelerate this routine.
+int64_t ConsumeJsonWhitespace(std::string_view view, bool trailing) {
+  if (!trailing) {
+    const auto pos = view.find_first_not_of(" \t\r\n");
+    return static_cast<int64_t>(pos == std::string_view::npos ? view.size() : 
pos);

Review Comment:
   So it's returning the number of leading/trailing whitespace characters in 
both cases? Perhaps say it like that to make it appear less confusing?



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