| 1425 | } // namespace |
| 1426 | |
| 1427 | absl::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 | |
| 1441 | absl::StatusOr<bool> MessageFieldEquals( |
| 1442 | const Message& lhs, const FieldDescriptor* absl_nonnull lhs_field, |