felipecrv commented on code in PR #35003:
URL: https://github.com/apache/arrow/pull/35003#discussion_r1370822185


##########
cpp/src/arrow/util/ree_util.cc:
##########
@@ -61,6 +61,62 @@ int64_t LogicalNullCount(const ArraySpan& span) {
   return LogicalNullCount<int64_t>(span);
 }
 
+namespace internal {
+
+/// \pre 0 <= i < array_span_.length()
+template <typename RunEndCType>
+int64_t FindPhysicalIndexImpl(PhysicalIndexFinder<RunEndCType>& self, int64_t 
i) {
+  DCHECK_LT(i, self.array_span.length);
+  const int64_t run_ends_size = ree_util::RunEndsArray(self.array_span).length;
+  DCHECK_LT(self.last_physical_index, run_ends_size);
+  // This access to self.run_ends_[last_physical_index_] is always safe 
because:
+  // 1. 0 <= i < array_span_.length() implies there is at least one run and 
the initial
+  //    value 0 will be safe to index with.
+  // 2. last_physical_index_ > 0 is always the result of a valid call to

Review Comment:
   Oops. Missed these when I renamed the struct members.



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