Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another fix for offsets_end() iterator in lists_column_view #7575

Merged
merged 1 commit into from
Mar 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions cpp/include/cudf/lists/lists_column_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,16 @@ class lists_column_view : private column_view {
}

/**
* @brief Return one past the last offset
* @brief Return pointer to the position that is one past the last offset
*
* This function return the position that is one past the last offset of the lists column.
* Since the current lists column may be a sliced column, this offsets_end() iterator should not
* be computed using the size of the offsets() child column, which is also the offsets of the
* entire original (non-sliced) lists column.
*
* @return int32_t const* Pointer to one past the last offset
*/
offset_iterator offsets_end() const noexcept { return offsets_begin() + offsets().size(); }
offset_iterator offsets_end() const noexcept { return offsets_begin() + size() + 1; }
};
/** @} */ // end of group
} // namespace cudf