From f8e710c2721c146baa9b633b2d1348b52f37c74e Mon Sep 17 00:00:00 2001 From: Sreesh Maheshwar Date: Sun, 31 Aug 2025 00:07:59 +0100 Subject: [PATCH] Nit: Default equality operators for statistic file structs --- src/iceberg/statistics_file.h | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/iceberg/statistics_file.h b/src/iceberg/statistics_file.h index 7ec01d49d..38cbb2d34 100644 --- a/src/iceberg/statistics_file.h +++ b/src/iceberg/statistics_file.h @@ -45,11 +45,7 @@ struct ICEBERG_EXPORT BlobMetadata { std::unordered_map properties; /// \brief Compare two BlobMetadatas for equality. - friend bool operator==(const BlobMetadata& lhs, const BlobMetadata& rhs) { - return lhs.type == rhs.type && lhs.source_snapshot_id == rhs.source_snapshot_id && - lhs.source_snapshot_sequence_number == rhs.source_snapshot_sequence_number && - lhs.fields == rhs.fields && lhs.properties == rhs.properties; - } + friend bool operator==(const BlobMetadata& lhs, const BlobMetadata& rhs) = default; }; /// \brief Represents a statistics file in the Puffin format @@ -66,12 +62,7 @@ struct ICEBERG_EXPORT StatisticsFile { std::vector blob_metadata; /// \brief Compare two StatisticsFiles for equality. - friend bool operator==(const StatisticsFile& lhs, const StatisticsFile& rhs) { - return lhs.snapshot_id == rhs.snapshot_id && lhs.path == rhs.path && - lhs.file_size_in_bytes == rhs.file_size_in_bytes && - lhs.file_footer_size_in_bytes == rhs.file_footer_size_in_bytes && - lhs.blob_metadata == rhs.blob_metadata; - } + friend bool operator==(const StatisticsFile& lhs, const StatisticsFile& rhs) = default; }; /// \brief Represents a partition statistics file @@ -86,10 +77,7 @@ struct ICEBERG_EXPORT PartitionStatisticsFile { /// \brief Compare two PartitionStatisticsFiles for equality. friend bool operator==(const PartitionStatisticsFile& lhs, - const PartitionStatisticsFile& rhs) { - return lhs.snapshot_id == rhs.snapshot_id && lhs.path == rhs.path && - lhs.file_size_in_bytes == rhs.file_size_in_bytes; - } + const PartitionStatisticsFile& rhs) = default; }; /// \brief Returns a string representation of a BlobMetadata