MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / MessageEquals

Function MessageEquals

internal/message_equality.cc:1427–1439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1425} // namespace
1426
1427absl::StatusOr<bool> MessageEquals(const Message& lhs, const Message& rhs,
1428 const DescriptorPool* absl_nonnull pool,
1429 MessageFactory* absl_nonnull factory) {
1430 ABSL_DCHECK(pool != nullptr);
1431 ABSL_DCHECK(factory != nullptr);
1432 if (&lhs == &rhs) {
1433 return true;
1434 }
1435 // MessageEqualsState has quite a large size, so we allocate it on the heap.
1436 // Ideally we should just hold most of the state at runtime in something like
1437 // `FlatExpressionEvaluatorState`, so we can avoid allocating this repeatedly.
1438 return std::make_unique<MessageEqualsState>(pool, factory)->Equals(lhs, rhs);
1439}
1440
1441absl::StatusOr<bool> MessageFieldEquals(
1442 const Message& lhs, const FieldDescriptor* absl_nonnull lhs_field,

Callers 2

TEST_PFunction · 0.85
TESTFunction · 0.85

Calls 1

EqualsMethod · 0.45

Tested by 2

TEST_PFunction · 0.68
TESTFunction · 0.68