Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
acezen committed Feb 2, 2024
1 parent f4e6cb5 commit f703ce7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
10 changes: 5 additions & 5 deletions cpp/include/gar/graph_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<const InfoVersion> version = nullptr,
const std::unordered_map<std::string, std::string>& extra_info = {});
explicit GraphInfo(
const std::string& graph_name, VertexInfoVector vertex_infos,
EdgeInfoVector edge_infos, const std::string& prefix = "./",
std::shared_ptr<const InfoVersion> version = nullptr,
const std::unordered_map<std::string, std::string>& extra_info = {});

/**
* @brief Loads the input file as a `GraphInfo` instance.
Expand Down
13 changes: 6 additions & 7 deletions cpp/src/graph_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1024,11 +1024,11 @@ class GraphInfo::Impl {
std::unordered_map<std::string, int> elabel_to_index_;
};

GraphInfo::GraphInfo(const std::string& graph_name,
VertexInfoVector vertex_infos, EdgeInfoVector edge_infos,
const std::string& prefix,
std::shared_ptr<const InfoVersion> version,
const std::unordered_map<std::string, std::string>& extra_info)
GraphInfo::GraphInfo(
const std::string& graph_name, VertexInfoVector vertex_infos,
EdgeInfoVector edge_infos, const std::string& prefix,
std::shared_ptr<const InfoVersion> version,
const std::unordered_map<std::string, std::string>& extra_info)
: impl_(new Impl(graph_name, std::move(vertex_infos), std::move(edge_infos),
prefix, version, extra_info)) {}

Expand Down Expand Up @@ -1196,8 +1196,7 @@ Result<std::string> 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;
Expand Down
6 changes: 3 additions & 3 deletions cpp/test/test_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit f703ce7

Please sign in to comment.