Skip to content

Commit

Permalink
Fix splitvec's .data() method to not dereferecne with no reason
Browse files Browse the repository at this point in the history
  • Loading branch information
kstppd committed Feb 1, 2024
1 parent e63a493 commit d21a3dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/splitvector/splitvec.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,14 +602,14 @@ class SplitVector {
*
* @return Pointer to the data.
*/
HOSTDEVICE T* data() noexcept { return &(_data[0]); }
HOSTDEVICE T* data() noexcept { return _data; }

/**
* @brief Returns a const raw pointer to the data stored in the SplitVector.
*
* @return Const pointer to the data.
*/
HOSTDEVICE const T* data() const noexcept { return &(_data[0]); }
HOSTDEVICE const T* data() const noexcept { return _data; }

/**
* @brief Reallocates data to a bigger chunk of memory.
Expand Down

0 comments on commit d21a3dd

Please sign in to comment.