Skip to content
This repository was archived by the owner on Oct 21, 2024. It is now read-only.

Commit 9ca93ab

Browse files
committed
Implementing review feedback.
1 parent 1b922f6 commit 9ca93ab

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

cpp/src/arrow/sparse_tensor.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,8 +1006,8 @@ Result<std::shared_ptr<SparseCSFIndex>> SparseCSFIndex::Make(
10061006
const std::shared_ptr<DataType>& indptr_type,
10071007
const std::shared_ptr<DataType>& indices_type,
10081008
const std::vector<int64_t>& indices_shapes, const std::vector<int64_t>& axis_order,
1009-
std::vector<std::shared_ptr<Buffer>> indptr_data,
1010-
std::vector<std::shared_ptr<Buffer>> indices_data) {
1009+
const std::vector<std::shared_ptr<Buffer>>& indptr_data,
1010+
const std::vector<std::shared_ptr<Buffer>>& indices_data) {
10111011
int64_t ndim = axis_order.size();
10121012
std::vector<std::shared_ptr<Tensor>> indptr(ndim - 1);
10131013
std::vector<std::shared_ptr<Tensor>> indices(ndim);
@@ -1027,8 +1027,8 @@ Result<std::shared_ptr<SparseCSFIndex>> SparseCSFIndex::Make(
10271027
}
10281028

10291029
// Constructor with two index vectors
1030-
SparseCSFIndex::SparseCSFIndex(std::vector<std::shared_ptr<Tensor>>& indptr,
1031-
std::vector<std::shared_ptr<Tensor>>& indices,
1030+
SparseCSFIndex::SparseCSFIndex(const std::vector<std::shared_ptr<Tensor>>& indptr,
1031+
const std::vector<std::shared_ptr<Tensor>>& indices,
10321032
const std::vector<int64_t>& axis_order)
10331033
: SparseIndexBase(indices.back()->size()),
10341034
indptr_(indptr),

cpp/src/arrow/sparse_tensor.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -354,22 +354,22 @@ class ARROW_EXPORT SparseCSFIndex : public internal::SparseIndexBase<SparseCSFIn
354354
const std::shared_ptr<DataType>& indptr_type,
355355
const std::shared_ptr<DataType>& indices_type,
356356
const std::vector<int64_t>& indices_shapes, const std::vector<int64_t>& axis_order,
357-
std::vector<std::shared_ptr<Buffer>> indptr_data,
358-
std::vector<std::shared_ptr<Buffer>> indices_data);
357+
const std::vector<std::shared_ptr<Buffer>>& indptr_data,
358+
const std::vector<std::shared_ptr<Buffer>>& indices_data);
359359

360360
/// \brief Make SparseCSFIndex from raw properties
361361
static Result<std::shared_ptr<SparseCSFIndex>> Make(
362362
const std::shared_ptr<DataType>& indices_type,
363363
const std::vector<int64_t>& indices_shapes, const std::vector<int64_t>& axis_order,
364-
std::vector<std::shared_ptr<Buffer>> indptr_data,
365-
std::vector<std::shared_ptr<Buffer>> indices_data) {
364+
const std::vector<std::shared_ptr<Buffer>>& indptr_data,
365+
const std::vector<std::shared_ptr<Buffer>>& indices_data) {
366366
return Make(indices_type, indices_type, indices_shapes, axis_order, indptr_data,
367367
indices_data);
368368
}
369369

370370
/// \brief Construct SparseCSFIndex from two index vectors
371-
explicit SparseCSFIndex(std::vector<std::shared_ptr<Tensor>>& indptr,
372-
std::vector<std::shared_ptr<Tensor>>& indices,
371+
explicit SparseCSFIndex(const std::vector<std::shared_ptr<Tensor>>& indptr,
372+
const std::vector<std::shared_ptr<Tensor>>& indices,
373373
const std::vector<int64_t>& axis_order);
374374

375375
/// \brief Return a 1D vector of indptr tensors

cpp/src/arrow/sparse_tensor_test.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -950,8 +950,9 @@ class TestSparseCSFTensorForIndexValueType
950950
protected:
951951
std::shared_ptr<SparseCSFIndex> MakeSparseCSFIndex(
952952
const std::vector<int64_t>& axis_order,
953-
std::vector<std::vector<typename IndexValueType::c_type>>& indptr_values,
954-
std::vector<std::vector<typename IndexValueType::c_type>>& indices_values) const {
953+
const std::vector<std::vector<typename IndexValueType::c_type>>& indptr_values,
954+
const std::vector<std::vector<typename IndexValueType::c_type>>& indices_values)
955+
const {
955956
int64_t ndim = axis_order.size();
956957
std::vector<std::shared_ptr<Tensor>> indptr(ndim - 1);
957958
std::vector<std::shared_ptr<Tensor>> indices(ndim);

0 commit comments

Comments
 (0)