MCPcopy Create free account
hub / github.com/apache/arrow / GetEditPoint

Method GetEditPoint

cpp/src/arrow/array/diff.cc:418–428  ·  view source on GitHub ↗

given edit_count and index, augment endpoint_base_[index] with the corresponding position in target (which is only implicitly represented in edit_count, index)

Source from the content-addressed store, hash-verified

416 // given edit_count and index, augment endpoint_base_[index] with the corresponding
417 // position in target (which is only implicitly represented in edit_count, index)
418 EditPoint GetEditPoint(int64_t edit_count, int64_t index) const {
419 DCHECK_GE(index, StorageOffset(edit_count));
420 DCHECK_LT(index, StorageOffset(edit_count + 1));
421 auto insertions_minus_deletions =
422 2 * (index - StorageOffset(edit_count)) - edit_count;
423 auto maximal_base = endpoint_base_[index];
424 auto maximal_target = std::min(
425 target_begin_ + ((maximal_base - base_begin_) + insertions_minus_deletions),
426 target_end_);
427 return {maximal_base, maximal_target};
428 }
429
430 void Next() {
431 ++edit_count_;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected