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
rapidsai#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 rapidsai#7528, thus it must be merged before that PR.

Authors:
  - Nghia Truong (@ttnghia)

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

URL: rapidsai#7551
  • Loading branch information
ttnghia authored and hyperbolic2346 committed Mar 23, 2021
1 parent 0e2736a commit 4d1812f
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 4d1812f

Please sign in to comment.