Update src/query/v2/plan/operator.cpp

Co-authored-by: Jure Bajic <jure.bajic@memgraph.com>
This commit is contained in:
gvolfing 2023-02-08 11:41:43 +01:00 committed by GitHub
parent 37f19867b0
commit 25226cca92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1335,15 +1335,12 @@ bool ContainsSameEdge(const TypedValue &a, const TypedValue &b) {
}
bool IsExpansionOk(Frame &frame, const Symbol &expand_symbol, const std::vector<Symbol> &previous_symbols) {
const auto &expand_value = frame[expand_symbol];
for (const auto &previous_symbol : previous_symbols) {
const auto &previous_value = frame[previous_symbol];
// This shouldn't raise a TypedValueException, because the planner
// makes sure these are all of the expected type. In case they are not
// an error should be raised long before this code is executed.
if (ContainsSameEdge(previous_value, expand_value)) return false;
}
return true;
return std::ranges::all_of(previous_symbols, [&expand_value = frame[expand_symbol]](const auto& previous_symbol) {
return ContainsSameEdge(previous_value, expand_value);
});
}
} // namespace