Skip to content

Commit

Permalink
Fix offset_end iterator for lists_column_view, which was not correctl… (
Browse files Browse the repository at this point in the history
#7551)

Fix the `offset_end` iterator in `lists_column_view`. Since the offset column size is one element larger than the number of column rows, the `offset_end` should be computed as `offset_begin() + size() + 1`. This can also be done by `offset_begin() + offsets().size()`.

This PR blocks #7528, thus it must be merged before that PR.

Authors:
  - Nghia Truong (@ttnghia)

Approvers:
  - Jake Hemstad (@jrhemstad)
  - Mike Wilson (@hyperbolic2346)
  - Vukasin Milovanovic (@vuule)

URL: #7551
  • Loading branch information
ttnghia authored Mar 10, 2021
1 parent 85edbfa commit 2d055c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/include/cudf/lists/lists_column_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class lists_column_view : private column_view {
*
* @return int32_t const* Pointer to one past the last offset
*/
offset_iterator offsets_end() const noexcept { return offsets_begin() + size(); }
offset_iterator offsets_end() const noexcept { return offsets_begin() + offsets().size(); }
};
/** @} */ // end of group
} // namespace cudf

0 comments on commit 2d055c3

Please sign in to comment.