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

Function MessageFieldEquals

internal/message_equality.cc:1441–1458  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1439}
1440
1441absl::StatusOr<bool> MessageFieldEquals(
1442 const Message& lhs, const FieldDescriptor* absl_nonnull lhs_field,
1443 const Message& rhs, const FieldDescriptor* absl_nonnull rhs_field,
1444 const DescriptorPool* absl_nonnull pool,
1445 MessageFactory* absl_nonnull factory) {
1446 ABSL_DCHECK(lhs_field != nullptr);
1447 ABSL_DCHECK(rhs_field != nullptr);
1448 ABSL_DCHECK(pool != nullptr);
1449 ABSL_DCHECK(factory != nullptr);
1450 if (&lhs == &rhs && lhs_field == rhs_field) {
1451 return true;
1452 }
1453 // MessageEqualsState has quite a large size, so we allocate it on the heap.
1454 // Ideally we should just hold most of the state at runtime in something like
1455 // `FlatExpressionEvaluatorState`, so we can avoid allocating this repeatedly.
1456 return std::make_unique<MessageEqualsState>(pool, factory)
1457 ->FieldEquals(lhs, lhs_field, rhs, rhs_field);
1458}
1459
1460absl::StatusOr<bool> MessageFieldEquals(
1461 const google::protobuf::Message& lhs, const google::protobuf::Message& rhs,

Callers 2

TEST_PFunction · 0.85
TESTFunction · 0.85

Calls 1

FieldEqualsMethod · 0.80

Tested by 2

TEST_PFunction · 0.68
TESTFunction · 0.68