Reranko05 commented on code in PR #51038:
URL: https://github.com/apache/arrow/pull/51038#discussion_r4085260247
##########
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:
Okay, my bad I got confused. I changed it to
```
/// Returns the position of the first non-whitespace character when trailing
is false,
/// or the number of trailing whitespace characters when trailing is true.
```
is this fine?
--
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]