From d820d0a9e52030c9aef7327d0dc511cfb4834a22 Mon Sep 17 00:00:00 2001 From: jbajic Date: Wed, 23 Nov 2022 22:29:03 +0100 Subject: [PATCH] Fix clang tidy errors --- src/glue/v2/communication.cpp | 28 ++++++++++++++-------------- src/storage/v3/request_helper.cpp | 10 +++++----- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/glue/v2/communication.cpp b/src/glue/v2/communication.cpp index cd3f41255..eedf699bb 100644 --- a/src/glue/v2/communication.cpp +++ b/src/glue/v2/communication.cpp @@ -120,15 +120,15 @@ Value ToBoltValue(const query::v2::TypedValue &value, const msgs::ShardRequestMa storage::v3::View view) { switch (value.type()) { case query::v2::TypedValue::Type::Null: - return Value(); + return {}; case query::v2::TypedValue::Type::Bool: - return Value(value.ValueBool()); + return {value.ValueBool()}; case query::v2::TypedValue::Type::Int: - return Value(value.ValueInt()); + return {value.ValueInt()}; case query::v2::TypedValue::Type::Double: - return Value(value.ValueDouble()); + return {value.ValueDouble()}; case query::v2::TypedValue::Type::String: - return Value(std::string(value.ValueString())); + return {std::string(value.ValueString())}; case query::v2::TypedValue::Type::List: { std::vector values; values.reserve(value.ValueList().size()); @@ -136,7 +136,7 @@ Value ToBoltValue(const query::v2::TypedValue &value, const msgs::ShardRequestMa auto value = ToBoltValue(v, shard_request_manager, view); values.emplace_back(std::move(value)); } - return Value(std::move(values)); + return {std::move(values)}; } case query::v2::TypedValue::Type::Map: { std::map map; @@ -144,28 +144,28 @@ Value ToBoltValue(const query::v2::TypedValue &value, const msgs::ShardRequestMa auto value = ToBoltValue(kv.second, shard_request_manager, view); map.emplace(kv.first, std::move(value)); } - return Value(std::move(map)); + return {std::move(map)}; } case query::v2::TypedValue::Type::Vertex: { auto vertex = ToBoltVertex(value.ValueVertex(), shard_request_manager, view); - return Value(std::move(vertex)); + return {std::move(vertex)}; } case query::v2::TypedValue::Type::Edge: { auto edge = ToBoltEdge(value.ValueEdge(), shard_request_manager, view); - return Value(std::move(edge)); + return {std::move(edge)}; } case query::v2::TypedValue::Type::Path: { auto path = ToBoltPath(value.ValuePath(), shard_request_manager, view); - return Value(std::move(path)); + return {std::move(path)}; } case query::v2::TypedValue::Type::Date: - return Value(value.ValueDate()); + return {value.ValueDate()}; case query::v2::TypedValue::Type::LocalTime: - return Value(value.ValueLocalTime()); + return {value.ValueLocalTime()}; case query::v2::TypedValue::Type::LocalDateTime: - return Value(value.ValueLocalDateTime()); + return {value.ValueLocalDateTime()}; case query::v2::TypedValue::Type::Duration: - return Value(value.ValueDuration()); + return {value.ValueDuration()}; } } diff --git a/src/storage/v3/request_helper.cpp b/src/storage/v3/request_helper.cpp index 6a0d6da7e..dd94309ab 100644 --- a/src/storage/v3/request_helper.cpp +++ b/src/storage/v3/request_helper.cpp @@ -360,7 +360,7 @@ bool FilterOnVertex(DbAccessor &dba, const storage::v3::VertexAccessor &v_acc, c ShardResult GetExpandOneResult( Shard::Accessor &acc, msgs::VertexId src_vertex, const msgs::ExpandOneRequest &req, - const EdgeUniquenessFunction &maybe_filter_based_on_edge_uniquness, const EdgeFiller &edge_filler, + const EdgeUniquenessFunction &maybe_filter_based_on_edge_uniqueness, const EdgeFiller &edge_filler, const Schemas::Schema &schema) { /// Fill up source vertex const auto primary_key = ConvertPropertyVector(src_vertex.second); @@ -379,7 +379,7 @@ ShardResult GetExpandOneResult( } /// Fill up connecting edges - auto fill_up_connecting_edges = FillUpConnectingEdges(v_acc, req, maybe_filter_based_on_edge_uniquness); + auto fill_up_connecting_edges = FillUpConnectingEdges(v_acc, req, maybe_filter_based_on_edge_uniqueness); if (fill_up_connecting_edges.HasError()) { return fill_up_connecting_edges.GetError(); } @@ -403,7 +403,7 @@ ShardResult GetExpandOneResult( ShardResult GetExpandOneResult( VertexAccessor v_acc, msgs::VertexId src_vertex, const msgs::ExpandOneRequest &req, std::vector in_edge_accessors, std::vector out_edge_accessors, - const EdgeUniquenessFunction &maybe_filter_based_on_edge_uniquness, const EdgeFiller &edge_filler, + const EdgeUniquenessFunction &maybe_filter_based_on_edge_uniqueness, const EdgeFiller &edge_filler, const Schemas::Schema &schema) { /// Fill up source vertex msgs::Vertex source_vertex = {.id = src_vertex}; @@ -420,8 +420,8 @@ ShardResult GetExpandOneResult( } /// Fill up connecting edges - auto in_edges = maybe_filter_based_on_edge_uniquness(std::move(in_edge_accessors), msgs::EdgeDirection::IN); - auto out_edges = maybe_filter_based_on_edge_uniquness(std::move(out_edge_accessors), msgs::EdgeDirection::OUT); + auto in_edges = maybe_filter_based_on_edge_uniqueness(std::move(in_edge_accessors), msgs::EdgeDirection::IN); + auto out_edges = maybe_filter_based_on_edge_uniqueness(std::move(out_edge_accessors), msgs::EdgeDirection::OUT); msgs::ExpandOneResultRow result_row; result_row.src_vertex = std::move(source_vertex);