Move primary keys

This commit is contained in:
János Benjamin Antal 2023-02-24 08:56:13 +01:00
parent 51ed451b82
commit 24d2353e7a

View File

@ -46,7 +46,6 @@ struct VertexIdCmpr {
std::optional<std::map<PropertyId, Value>> PrimaryKeysFromAccessor(const VertexAccessor &acc, View view, std::optional<std::map<PropertyId, Value>> PrimaryKeysFromAccessor(const VertexAccessor &acc, View view,
const Schemas::Schema &schema) { const Schemas::Schema &schema) {
std::map<PropertyId, Value> ret; std::map<PropertyId, Value> ret;
auto props = acc.Properties(view);
auto maybe_pk = acc.PrimaryKey(view); auto maybe_pk = acc.PrimaryKey(view);
if (maybe_pk.HasError()) { if (maybe_pk.HasError()) {
spdlog::debug("Encountered an error while trying to get vertex primary key."); spdlog::debug("Encountered an error while trying to get vertex primary key.");
@ -58,7 +57,7 @@ std::optional<std::map<PropertyId, Value>> PrimaryKeysFromAccessor(const VertexA
ret.emplace(schema.second[i].property_id, FromPropertyValueToValue(std::move(pk[i]))); ret.emplace(schema.second[i].property_id, FromPropertyValueToValue(std::move(pk[i])));
} }
return ret; return {std::move(ret)};
} }
ShardResult<std::vector<msgs::Label>> FillUpSourceVertexSecondaryLabels(const std::optional<VertexAccessor> &v_acc, ShardResult<std::vector<msgs::Label>> FillUpSourceVertexSecondaryLabels(const std::optional<VertexAccessor> &v_acc,
@ -99,7 +98,7 @@ ShardResult<std::map<PropertyId, Value>> FillUpSourceVertexProperties(const std:
} }
auto pks = PrimaryKeysFromAccessor(*v_acc, view, schema); auto pks = PrimaryKeysFromAccessor(*v_acc, view, schema);
if (pks) { if (pks) {
src_vertex_properties.merge(*pks); src_vertex_properties.merge(std::move(*pks));
} }
} else if (req.src_vertex_properties.value().empty()) { } else if (req.src_vertex_properties.value().empty()) {