Skip to content

Commit 6ef6ad0

Browse files
committed
Apply code formatter
1 parent 6f29158 commit 6ef6ad0

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

cpp/src/arrow/compare.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,8 @@ struct SparseTensorEqualsImpl<SparseIndexType, SparseIndexType> {
816816
const uint8_t* left_data = left.data()->data();
817817
const uint8_t* right_data = right.data()->data();
818818

819-
return memcmp(left_data, right_data, static_cast<size_t>(byte_width * left.non_zero_length()));
819+
return memcmp(left_data, right_data,
820+
static_cast<size_t>(byte_width * left.non_zero_length()));
820821
}
821822
};
822823

cpp/src/arrow/ipc/metadata-internal.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -865,8 +865,9 @@ Status MakeSparseTensor(FBB& fbb, const SparseTensorBase& sparse_tensor,
865865

866866
const int64_t non_zero_length = sparse_tensor.non_zero_length();
867867

868-
*offset = flatbuf::CreateSparseTensor(fbb, fb_type_type, fb_type, fb_shape, non_zero_length,
869-
fb_sparse_index_type, fb_sparse_index, &data);
868+
*offset =
869+
flatbuf::CreateSparseTensor(fbb, fb_type_type, fb_type, fb_shape, non_zero_length,
870+
fb_sparse_index_type, fb_sparse_index, &data);
870871

871872
return Status::OK();
872873
}
@@ -1037,7 +1038,8 @@ Status GetTensorMetadata(const Buffer& metadata, std::shared_ptr<DataType>* type
10371038

10381039
Status GetSparseTensorMetadata(const Buffer& metadata, std::shared_ptr<DataType>* type,
10391040
std::vector<int64_t>* shape,
1040-
std::vector<std::string>* dim_names, int64_t* non_zero_length,
1041+
std::vector<std::string>* dim_names,
1042+
int64_t* non_zero_length,
10411043
SparseTensorFormat::type* sparse_tensor_format_id) {
10421044
auto message = flatbuf::GetMessage(metadata.data());
10431045
if (message->header_type() != flatbuf::MessageHeader_SparseTensor) {

cpp/src/arrow/ipc/reader.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -800,8 +800,8 @@ Status ReadSparseTensor(const Buffer& metadata, io::RandomAccessFile* file,
800800
int64_t non_zero_length;
801801
SparseTensorFormat::type sparse_tensor_format_id;
802802

803-
RETURN_NOT_OK(internal::GetSparseTensorMetadata(metadata, &type, &shape, &dim_names,
804-
&non_zero_length, &sparse_tensor_format_id));
803+
RETURN_NOT_OK(internal::GetSparseTensorMetadata(
804+
metadata, &type, &shape, &dim_names, &non_zero_length, &sparse_tensor_format_id));
805805

806806
auto message = flatbuf::GetMessage(metadata.data());
807807
auto sparse_tensor = reinterpret_cast<const flatbuf::SparseTensor*>(message->header());
@@ -816,15 +816,15 @@ Status ReadSparseTensor(const Buffer& metadata, io::RandomAccessFile* file,
816816
std::shared_ptr<SparseIndex> sparse_index;
817817
switch (sparse_tensor_format_id) {
818818
case SparseTensorFormat::COO:
819-
RETURN_NOT_OK(
820-
ReadSparseCOOIndex(sparse_tensor, shape.size(), non_zero_length, file, &sparse_index));
819+
RETURN_NOT_OK(ReadSparseCOOIndex(sparse_tensor, shape.size(), non_zero_length, file,
820+
&sparse_index));
821821
return MakeSparseTensorWithSparseCOOIndex(
822822
type, shape, dim_names, std::dynamic_pointer_cast<SparseCOOIndex>(sparse_index),
823823
non_zero_length, data, out);
824824

825825
case SparseTensorFormat::CSR:
826-
RETURN_NOT_OK(
827-
ReadSparseCSRIndex(sparse_tensor, shape.size(), non_zero_length, file, &sparse_index));
826+
RETURN_NOT_OK(ReadSparseCSRIndex(sparse_tensor, shape.size(), non_zero_length, file,
827+
&sparse_index));
828828
return MakeSparseTensorWithSparseCSRIndex(
829829
type, shape, dim_names, std::dynamic_pointer_cast<SparseCSRIndex>(sparse_index),
830830
non_zero_length, data, out);

cpp/src/arrow/sparse_tensor.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ class ARROW_EXPORT SparseTensorBase {
142142
bool is_mutable() const { return data_->is_mutable(); }
143143

144144
/// Total number of non-zero cells in the sparse tensor
145-
int64_t non_zero_length() const { return sparse_index_ ? sparse_index_->non_zero_length() : 0; }
145+
int64_t non_zero_length() const {
146+
return sparse_index_ ? sparse_index_->non_zero_length() : 0;
147+
}
146148

147149
bool Equals(const SparseTensorBase& other) const;
148150

0 commit comments

Comments
 (0)