From f703ce7fa903504c6fd387f244e6cb8f06a420da Mon Sep 17 00:00:00 2001 From: acezen Date: Fri, 2 Feb 2024 10:34:07 +0800 Subject: [PATCH] Format --- cpp/include/gar/graph_info.h | 10 +++++----- cpp/src/graph_info.cc | 13 ++++++------- cpp/test/test_info.cc | 6 +++--- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/cpp/include/gar/graph_info.h b/cpp/include/gar/graph_info.h index 8634bd3e6..8448aed8d 100644 --- a/cpp/include/gar/graph_info.h +++ b/cpp/include/gar/graph_info.h @@ -656,11 +656,11 @@ class GraphInfo { * @param version The version of the graph info. * @param extra_info The extra metadata of the graph info. */ - explicit GraphInfo(const std::string& graph_name, - VertexInfoVector vertex_infos, EdgeInfoVector edge_infos, - const std::string& prefix = "./", - std::shared_ptr version = nullptr, - const std::unordered_map& extra_info = {}); + explicit GraphInfo( + const std::string& graph_name, VertexInfoVector vertex_infos, + EdgeInfoVector edge_infos, const std::string& prefix = "./", + std::shared_ptr version = nullptr, + const std::unordered_map& extra_info = {}); /** * @brief Loads the input file as a `GraphInfo` instance. diff --git a/cpp/src/graph_info.cc b/cpp/src/graph_info.cc index a9c915df1..7769b64ac 100644 --- a/cpp/src/graph_info.cc +++ b/cpp/src/graph_info.cc @@ -1024,11 +1024,11 @@ class GraphInfo::Impl { std::unordered_map elabel_to_index_; }; -GraphInfo::GraphInfo(const std::string& graph_name, - VertexInfoVector vertex_infos, EdgeInfoVector edge_infos, - const std::string& prefix, - std::shared_ptr version, - const std::unordered_map& extra_info) +GraphInfo::GraphInfo( + const std::string& graph_name, VertexInfoVector vertex_infos, + EdgeInfoVector edge_infos, const std::string& prefix, + std::shared_ptr version, + const std::unordered_map& extra_info) : impl_(new Impl(graph_name, std::move(vertex_infos), std::move(edge_infos), prefix, version, extra_info)) {} @@ -1196,8 +1196,7 @@ Result GraphInfo::Dump() const { extra_info_node["key"] = pair.first; extra_info_node["value"] = pair.second; node["extra_info"].PushBack(); - node["extra_info"][node["extra_info"].Size() - 1] = - extra_info_node; + node["extra_info"][node["extra_info"].Size() - 1] = extra_info_node; } } std::string dump_string; diff --git a/cpp/test/test_info.cc b/cpp/test/test_info.cc index beec464fb..d24e6f052 100644 --- a/cpp/test/test_info.cc +++ b/cpp/test/test_info.cc @@ -486,9 +486,9 @@ TEST_CASE("GraphInfo") { } SECTION("ExtraInfo") { - auto graph_info_with_extra_info = CreateGraphInfo( - name, {vertex_info}, {edge_info}, "test_graph/", version, - {{"key1", "value1"}, {"key2", "value2"}}); + auto graph_info_with_extra_info = + CreateGraphInfo(name, {vertex_info}, {edge_info}, "test_graph/", + version, {{"key1", "value1"}, {"key2", "value2"}}); const auto& extra_info = graph_info_with_extra_info->GetExtraInfo(); REQUIRE(extra_info.size() == 2); REQUIRE(extra_info.find("key1") != extra_info.end());