This is an automated email from the ASF dual-hosted git repository.
yangxk1 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-graphar.git
The following commit(s) were added to refs/heads/main by this push:
new c6983a86 style: add missing brackets and remove unused including
headers (#914)
c6983a86 is described below
commit c6983a86fbaa5e2c3609884f05550b03d6360993
Author: Jason <[email protected]>
AuthorDate: Thu May 7 20:37:05 2026 +0800
style: add missing brackets and remove unused including headers (#914)
* style: add missing brackets and remove unused including headers
Signed-off-by: syaojun <[email protected]>
* fix: CI error
Signed-off-by: syaojun <[email protected]>
* fix: ci error again
Signed-off-by: syaojun <[email protected]>
* fix: ci unstable
Signed-off-by: syaojun <[email protected]>
* fix: ci error
Signed-off-by: syaojun <[email protected]>
---------
Signed-off-by: syaojun <[email protected]>
Signed-off-by: Jason <[email protected]>
---
cpp/src/graphar/chunk_info_reader.h | 1 -
cpp/src/graphar/chunk_info_writer.h | 1 -
cpp/src/graphar/expression.h | 4 ++-
cpp/src/graphar/fwd.h | 2 +-
cpp/src/graphar/high-level/graph_reader.h | 36 +++++++++++++++++----------
cpp/src/graphar/high-level/vertices_builder.h | 3 ++-
cpp/src/graphar/macros.h | 2 --
cpp/src/graphar/types.h | 2 +-
8 files changed, 30 insertions(+), 21 deletions(-)
diff --git a/cpp/src/graphar/chunk_info_reader.h
b/cpp/src/graphar/chunk_info_reader.h
index de6a43f9..5aef2ee7 100644
--- a/cpp/src/graphar/chunk_info_reader.h
+++ b/cpp/src/graphar/chunk_info_reader.h
@@ -21,7 +21,6 @@
#include <memory>
#include <string>
-#include <vector>
#include "graphar/fwd.h"
diff --git a/cpp/src/graphar/chunk_info_writer.h
b/cpp/src/graphar/chunk_info_writer.h
index 0086bbd2..d184fc11 100644
--- a/cpp/src/graphar/chunk_info_writer.h
+++ b/cpp/src/graphar/chunk_info_writer.h
@@ -21,7 +21,6 @@
#include <memory>
#include <string>
-#include <vector>
#include "graphar/fwd.h"
#include "graphar/writer_util.h"
diff --git a/cpp/src/graphar/expression.h b/cpp/src/graphar/expression.h
index a578dc3a..a917e333 100644
--- a/cpp/src/graphar/expression.h
+++ b/cpp/src/graphar/expression.h
@@ -88,7 +88,9 @@ class ExpressionLiteral : public Expression {
ExpressionLiteral(const ExpressionLiteral& other) = default;
~ExpressionLiteral() = default;
- Result<ArrowExpression> Evaluate() { return arrow::compute::literal(value_);
}
+ Result<ArrowExpression> Evaluate() override {
+ return arrow::compute::literal(value_);
+ }
private:
T value_;
diff --git a/cpp/src/graphar/fwd.h b/cpp/src/graphar/fwd.h
index 52ef0ec6..9a101f8a 100644
--- a/cpp/src/graphar/fwd.h
+++ b/cpp/src/graphar/fwd.h
@@ -78,7 +78,7 @@ enum class FileType : int32_t { CSV = 0, PARQUET = 1, ORC =
2, JSON = 3 };
enum class SelectType : int32_t { PROPERTIES = 0, LABELS = 1 };
/** GetChunkVersion: V1 use scanner, V2 use FileReader */
enum class GetChunkVersion : int32_t { AUTO = 0, V1 = 1, V2 = 2 };
-enum class AdjListType : int32_t;
+enum class AdjListType;
template <typename T>
class Array;
diff --git a/cpp/src/graphar/high-level/graph_reader.h
b/cpp/src/graphar/high-level/graph_reader.h
index f67502ae..8b9788eb 100644
--- a/cpp/src/graphar/high-level/graph_reader.h
+++ b/cpp/src/graphar/high-level/graph_reader.h
@@ -355,9 +355,10 @@ class VerticesCollection {
/** The iterator pointing to the past-the-end element. */
VertexIter end() noexcept {
- if (is_filtered_)
+ if (is_filtered_) {
return VertexIter(vertex_info_, prefix_, filtered_ids_.size(), labels_,
is_filtered_, filtered_ids_);
+ }
return VertexIter(vertex_info_, prefix_, vertex_num_, labels_,
is_filtered_,
filtered_ids_);
}
@@ -369,10 +370,11 @@ class VerticesCollection {
/** Get the number of vertices in the collection. */
size_t size() const noexcept {
- if (is_filtered_)
+ if (is_filtered_) {
return filtered_ids_.size();
- else
+ } else {
return vertex_num_;
+ }
}
std::shared_ptr<VertexInfo> GetVertexInfo() const { return vertex_info_; }
@@ -718,16 +720,18 @@ class EdgeIter {
/** Point to the next edge with the same source, return false if not found.
*/
bool next_src() {
- if (is_end())
+ if (is_end()) {
return false;
+ }
IdType id = this->source();
IdType pre_vertex_chunk_index = vertex_chunk_index_;
if (adj_list_type_ == AdjListType::ordered_by_source) {
this->operator++();
- if (is_end() || this->source() != id)
+ if (is_end() || this->source() != id) {
return false;
- else
+ } else {
return true;
+ }
}
this->operator++();
while (!is_end()) {
@@ -735,8 +739,9 @@ class EdgeIter {
return true;
}
if (adj_list_type_ == AdjListType::unordered_by_source) {
- if (vertex_chunk_index_ > pre_vertex_chunk_index)
+ if (vertex_chunk_index_ > pre_vertex_chunk_index) {
return false;
+ }
}
this->operator++();
}
@@ -748,16 +753,18 @@ class EdgeIter {
* found.
*/
bool next_dst() {
- if (is_end())
+ if (is_end()) {
return false;
+ }
IdType id = this->destination();
IdType pre_vertex_chunk_index = vertex_chunk_index_;
if (adj_list_type_ == AdjListType::ordered_by_dest) {
this->operator++();
- if (is_end() || this->destination() != id)
+ if (is_end() || this->destination() != id) {
return false;
- else
+ } else {
return true;
+ }
}
this->operator++();
while (!is_end()) {
@@ -765,8 +772,9 @@ class EdgeIter {
return true;
}
if (adj_list_type_ == AdjListType::unordered_by_dest) {
- if (vertex_chunk_index_ > pre_vertex_chunk_index)
+ if (vertex_chunk_index_ > pre_vertex_chunk_index) {
return false;
+ }
}
this->operator++();
}
@@ -778,8 +786,9 @@ class EdgeIter {
* found.
*/
bool next_src(IdType id) {
- if (is_end())
+ if (is_end()) {
return false;
+ }
this->operator++();
return this->first_src(*this, id);
}
@@ -789,8 +798,9 @@ class EdgeIter {
* not found.
*/
bool next_dst(IdType id) {
- if (is_end())
+ if (is_end()) {
return false;
+ }
this->operator++();
return this->first_dst(*this, id);
}
diff --git a/cpp/src/graphar/high-level/vertices_builder.h
b/cpp/src/graphar/high-level/vertices_builder.h
index dc78c002..38632a22 100644
--- a/cpp/src/graphar/high-level/vertices_builder.h
+++ b/cpp/src/graphar/high-level/vertices_builder.h
@@ -337,8 +337,9 @@ class VerticesBuilder {
vertices_.push_back(v);
} else {
v.SetId(index);
- if (index >= static_cast<IdType>(vertices_.size()))
+ if (index >= static_cast<IdType>(vertices_.size())) {
vertices_.resize(index + 1);
+ }
vertices_[index] = v;
}
num_vertices_++;
diff --git a/cpp/src/graphar/macros.h b/cpp/src/graphar/macros.h
index a36cfafb..0e017ffa 100644
--- a/cpp/src/graphar/macros.h
+++ b/cpp/src/graphar/macros.h
@@ -19,8 +19,6 @@
#pragma once
-#include <cstdint>
-
// namespace config
#define GAR_EXPAND(x) x
diff --git a/cpp/src/graphar/types.h b/cpp/src/graphar/types.h
index 1a9d8baf..453718fa 100644
--- a/cpp/src/graphar/types.h
+++ b/cpp/src/graphar/types.h
@@ -170,7 +170,7 @@ class Date {
};
/** Adj list type enumeration for adjacency list of graph. */
-enum class AdjListType : std::int32_t {
+enum class AdjListType : int32_t {
/// collection of edges by source, but unordered, can represent COO format
unordered_by_source = 0b00000001,
/// collection of edges by destination, but unordered, can represent COO
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]