Fix clang tidy errors

This commit is contained in:
jbajic 2022-11-23 22:29:03 +01:00
parent 7aa68164f0
commit d820d0a9e5
2 changed files with 19 additions and 19 deletions

View File

@ -120,15 +120,15 @@ Value ToBoltValue(const query::v2::TypedValue &value, const msgs::ShardRequestMa
storage::v3::View view) { storage::v3::View view) {
switch (value.type()) { switch (value.type()) {
case query::v2::TypedValue::Type::Null: case query::v2::TypedValue::Type::Null:
return Value(); return {};
case query::v2::TypedValue::Type::Bool: case query::v2::TypedValue::Type::Bool:
return Value(value.ValueBool()); return {value.ValueBool()};
case query::v2::TypedValue::Type::Int: case query::v2::TypedValue::Type::Int:
return Value(value.ValueInt()); return {value.ValueInt()};
case query::v2::TypedValue::Type::Double: case query::v2::TypedValue::Type::Double:
return Value(value.ValueDouble()); return {value.ValueDouble()};
case query::v2::TypedValue::Type::String: case query::v2::TypedValue::Type::String:
return Value(std::string(value.ValueString())); return {std::string(value.ValueString())};
case query::v2::TypedValue::Type::List: { case query::v2::TypedValue::Type::List: {
std::vector<Value> values; std::vector<Value> values;
values.reserve(value.ValueList().size()); 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); auto value = ToBoltValue(v, shard_request_manager, view);
values.emplace_back(std::move(value)); values.emplace_back(std::move(value));
} }
return Value(std::move(values)); return {std::move(values)};
} }
case query::v2::TypedValue::Type::Map: { case query::v2::TypedValue::Type::Map: {
std::map<std::string, Value> map; std::map<std::string, Value> map;
@ -144,28 +144,28 @@ Value ToBoltValue(const query::v2::TypedValue &value, const msgs::ShardRequestMa
auto value = ToBoltValue(kv.second, shard_request_manager, view); auto value = ToBoltValue(kv.second, shard_request_manager, view);
map.emplace(kv.first, std::move(value)); map.emplace(kv.first, std::move(value));
} }
return Value(std::move(map)); return {std::move(map)};
} }
case query::v2::TypedValue::Type::Vertex: { case query::v2::TypedValue::Type::Vertex: {
auto vertex = ToBoltVertex(value.ValueVertex(), shard_request_manager, view); auto vertex = ToBoltVertex(value.ValueVertex(), shard_request_manager, view);
return Value(std::move(vertex)); return {std::move(vertex)};
} }
case query::v2::TypedValue::Type::Edge: { case query::v2::TypedValue::Type::Edge: {
auto edge = ToBoltEdge(value.ValueEdge(), shard_request_manager, view); auto edge = ToBoltEdge(value.ValueEdge(), shard_request_manager, view);
return Value(std::move(edge)); return {std::move(edge)};
} }
case query::v2::TypedValue::Type::Path: { case query::v2::TypedValue::Type::Path: {
auto path = ToBoltPath(value.ValuePath(), shard_request_manager, view); auto path = ToBoltPath(value.ValuePath(), shard_request_manager, view);
return Value(std::move(path)); return {std::move(path)};
} }
case query::v2::TypedValue::Type::Date: case query::v2::TypedValue::Type::Date:
return Value(value.ValueDate()); return {value.ValueDate()};
case query::v2::TypedValue::Type::LocalTime: case query::v2::TypedValue::Type::LocalTime:
return Value(value.ValueLocalTime()); return {value.ValueLocalTime()};
case query::v2::TypedValue::Type::LocalDateTime: case query::v2::TypedValue::Type::LocalDateTime:
return Value(value.ValueLocalDateTime()); return {value.ValueLocalDateTime()};
case query::v2::TypedValue::Type::Duration: case query::v2::TypedValue::Type::Duration:
return Value(value.ValueDuration()); return {value.ValueDuration()};
} }
} }

View File

@ -360,7 +360,7 @@ bool FilterOnVertex(DbAccessor &dba, const storage::v3::VertexAccessor &v_acc, c
ShardResult<msgs::ExpandOneResultRow> GetExpandOneResult( ShardResult<msgs::ExpandOneResultRow> GetExpandOneResult(
Shard::Accessor &acc, msgs::VertexId src_vertex, const msgs::ExpandOneRequest &req, 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) { const Schemas::Schema &schema) {
/// Fill up source vertex /// Fill up source vertex
const auto primary_key = ConvertPropertyVector(src_vertex.second); const auto primary_key = ConvertPropertyVector(src_vertex.second);
@ -379,7 +379,7 @@ ShardResult<msgs::ExpandOneResultRow> GetExpandOneResult(
} }
/// Fill up connecting edges /// 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()) { if (fill_up_connecting_edges.HasError()) {
return fill_up_connecting_edges.GetError(); return fill_up_connecting_edges.GetError();
} }
@ -403,7 +403,7 @@ ShardResult<msgs::ExpandOneResultRow> GetExpandOneResult(
ShardResult<msgs::ExpandOneResultRow> GetExpandOneResult( ShardResult<msgs::ExpandOneResultRow> GetExpandOneResult(
VertexAccessor v_acc, msgs::VertexId src_vertex, const msgs::ExpandOneRequest &req, VertexAccessor v_acc, msgs::VertexId src_vertex, const msgs::ExpandOneRequest &req,
std::vector<EdgeAccessor> in_edge_accessors, std::vector<EdgeAccessor> out_edge_accessors, std::vector<EdgeAccessor> in_edge_accessors, std::vector<EdgeAccessor> 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) { const Schemas::Schema &schema) {
/// Fill up source vertex /// Fill up source vertex
msgs::Vertex source_vertex = {.id = src_vertex}; msgs::Vertex source_vertex = {.id = src_vertex};
@ -420,8 +420,8 @@ ShardResult<msgs::ExpandOneResultRow> GetExpandOneResult(
} }
/// Fill up connecting edges /// Fill up connecting edges
auto in_edges = maybe_filter_based_on_edge_uniquness(std::move(in_edge_accessors), msgs::EdgeDirection::IN); 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_uniquness(std::move(out_edge_accessors), msgs::EdgeDirection::OUT); auto out_edges = maybe_filter_based_on_edge_uniqueness(std::move(out_edge_accessors), msgs::EdgeDirection::OUT);
msgs::ExpandOneResultRow result_row; msgs::ExpandOneResultRow result_row;
result_row.src_vertex = std::move(source_vertex); result_row.src_vertex = std::move(source_vertex);