From 0462b8fc8fd08a0d3d30a23e099422fd3395de50 Mon Sep 17 00:00:00 2001 From: jbajic Date: Mon, 14 Nov 2022 09:15:03 +0100 Subject: [PATCH] Address review comments --- src/query/v2/requests.hpp | 2 +- src/storage/v3/request_helper.cpp | 2 +- src/storage/v3/request_helper.hpp | 4 +--- src/utils/template_utils.hpp | 18 ++++++++++++++++++ 4 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 src/utils/template_utils.hpp diff --git a/src/query/v2/requests.hpp b/src/query/v2/requests.hpp index fe2851893..356e2c0da 100644 --- a/src/query/v2/requests.hpp +++ b/src/query/v2/requests.hpp @@ -452,7 +452,7 @@ struct ExpandOneResponse { struct UpdateVertex { PrimaryKey primary_key; - // This should be a map + // Labels are first added and then removed from vertices std::vector add_labels; std::vector remove_labels; std::map property_updates; diff --git a/src/storage/v3/request_helper.cpp b/src/storage/v3/request_helper.cpp index 5c0297581..0be659c43 100644 --- a/src/storage/v3/request_helper.cpp +++ b/src/storage/v3/request_helper.cpp @@ -107,7 +107,7 @@ void LogResultError(const ResultErrorType &error, const std::string_view action) break; } } else { - static_assert(kAlwaysFalse, "Missing type from variant visitor"); + static_assert(utils::kAlwaysFalse, "Missing type from variant visitor"); } }, error); diff --git a/src/storage/v3/request_helper.hpp b/src/storage/v3/request_helper.hpp index fc75f7717..1d26e338d 100644 --- a/src/storage/v3/request_helper.hpp +++ b/src/storage/v3/request_helper.hpp @@ -15,12 +15,10 @@ #include "storage/v3/bindings/typed_value.hpp" #include "storage/v3/shard.hpp" #include "storage/v3/vertex_accessor.hpp" +#include "utils/template_utils.hpp" namespace memgraph::storage::v3 { -template -constexpr auto kAlwaysFalse{false}; - inline bool TypedValueCompare(const TypedValue &a, const TypedValue &b) { // in ordering null comes after everything else // at the same time Null is not less that null diff --git a/src/utils/template_utils.hpp b/src/utils/template_utils.hpp new file mode 100644 index 000000000..e84cbc652 --- /dev/null +++ b/src/utils/template_utils.hpp @@ -0,0 +1,18 @@ +// Copyright 2022 Memgraph Ltd. +// +// Use of this software is governed by the Business Source License +// included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source +// License, and you may not use this file except in compliance with the Business Source License. +// +// As of the Change Date specified in that file, in accordance with +// the Business Source License, use of this software will be governed +// by the Apache License, Version 2.0, included in the file +// licenses/APL.txt. +#pragma once + +namespace memgraph::utils { + +template +constexpr auto kAlwaysFalse{false}; + +} // namespace memgraph::utils