Skip to content

Commit c984453

Browse files
committed
refactor: remove explicit operator!=
1 parent ed49d1e commit c984453

File tree

12 files changed

+2
-79
lines changed

12 files changed

+2
-79
lines changed

src/iceberg/partition_field.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ class ICEBERG_EXPORT PartitionField : public util::Formattable {
6262
return lhs.Equals(rhs);
6363
}
6464

65-
friend bool operator!=(const PartitionField& lhs, const PartitionField& rhs) {
66-
return !(lhs == rhs);
67-
}
68-
6965
private:
7066
/// \brief Compare two fields for equality.
7167
[[nodiscard]] bool Equals(const PartitionField& other) const;

src/iceberg/partition_spec.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ class ICEBERG_EXPORT PartitionSpec : public util::Formattable {
7575
return lhs.Equals(rhs);
7676
}
7777

78-
friend bool operator!=(const PartitionSpec& lhs, const PartitionSpec& rhs) {
79-
return !(lhs == rhs);
80-
}
81-
8278
private:
8379
/// \brief Compare two partition specs for equality.
8480
[[nodiscard]] bool Equals(const PartitionSpec& other) const;

src/iceberg/schema.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ class ICEBERG_EXPORT Schema : public StructType {
5656

5757
friend bool operator==(const Schema& lhs, const Schema& rhs) { return lhs.Equals(rhs); }
5858

59-
friend bool operator!=(const Schema& lhs, const Schema& rhs) { return !(lhs == rhs); }
60-
6159
private:
6260
/// \brief Compare two schemas for equality.
6361
[[nodiscard]] bool Equals(const Schema& other) const;

src/iceberg/schema_field.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ class ICEBERG_EXPORT SchemaField : public iceberg::util::Formattable {
7676
return lhs.Equals(rhs);
7777
}
7878

79-
friend bool operator!=(const SchemaField& lhs, const SchemaField& rhs) {
80-
return !(lhs == rhs);
81-
}
82-
8379
private:
8480
/// \brief Compare two fields for equality.
8581
[[nodiscard]] bool Equals(const SchemaField& other) const;

src/iceberg/snapshot.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ struct ICEBERG_EXPORT SnapshotRef {
8080
return lhs.Equals(rhs);
8181
}
8282

83-
/// \brief Compare two branches for inequality.
84-
friend bool operator!=(const Branch& lhs, const Branch& rhs) { return !(lhs == rhs); }
85-
8683
private:
8784
/// \brief Compare two branches for equality.
8885
bool Equals(const Branch& other) const;
@@ -97,9 +94,6 @@ struct ICEBERG_EXPORT SnapshotRef {
9794
/// \brief Compare two tags for equality.
9895
friend bool operator==(const Tag& lhs, const Tag& rhs) { return lhs.Equals(rhs); }
9996

100-
/// \brief Compare two tags for inequality.
101-
friend bool operator!=(const Tag& lhs, const Tag& rhs) { return !(lhs == rhs); }
102-
10397
private:
10498
/// \brief Compare two tags for equality.
10599
bool Equals(const Tag& other) const;
@@ -117,11 +111,6 @@ struct ICEBERG_EXPORT SnapshotRef {
117111
return lhs.Equals(rhs);
118112
}
119113

120-
/// \brief Compare two snapshot refs for inequality.
121-
friend bool operator!=(const SnapshotRef& lhs, const SnapshotRef& rhs) {
122-
return !(lhs == rhs);
123-
}
124-
125114
private:
126115
/// \brief Compare two snapshot refs for equality.
127116
bool Equals(const SnapshotRef& other) const;
@@ -263,11 +252,6 @@ struct ICEBERG_EXPORT Snapshot {
263252
return lhs.Equals(rhs);
264253
}
265254

266-
/// \brief Compare two snapshots for inequality.
267-
friend bool operator!=(const Snapshot& lhs, const Snapshot& rhs) {
268-
return !(lhs == rhs);
269-
}
270-
271255
private:
272256
/// \brief Compare two snapshots for equality.
273257
bool Equals(const Snapshot& other) const;

src/iceberg/sort_field.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,6 @@ class ICEBERG_EXPORT SortField : public util::Formattable {
113113
return lhs.Equals(rhs);
114114
}
115115

116-
friend bool operator!=(const SortField& lhs, const SortField& rhs) {
117-
return !(lhs == rhs);
118-
}
119-
120116
private:
121117
/// \brief Compare two fields for equality.
122118
[[nodiscard]] bool Equals(const SortField& other) const;

src/iceberg/sort_order.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ class ICEBERG_EXPORT SortOrder : public util::Formattable {
5555
return lhs.Equals(rhs);
5656
}
5757

58-
friend bool operator!=(const SortOrder& lhs, const SortOrder& rhs) {
59-
return !(lhs == rhs);
60-
}
61-
6258
private:
6359
/// \brief Compare two sort orders for equality.
6460
bool Equals(const SortOrder& other) const;

src/iceberg/statistics_file.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@ struct ICEBERG_EXPORT BlobMetadata {
5050
lhs.source_snapshot_sequence_number == rhs.source_snapshot_sequence_number &&
5151
lhs.fields == rhs.fields && lhs.properties == rhs.properties;
5252
}
53-
54-
/// \brief Compare two BlobMetadatas for inequality.
55-
friend bool operator!=(const BlobMetadata& lhs, const BlobMetadata& rhs) {
56-
return !(lhs == rhs);
57-
}
5853
};
5954

6055
/// \brief Represents a statistics file in the Puffin format
@@ -77,11 +72,6 @@ struct ICEBERG_EXPORT StatisticsFile {
7772
lhs.file_footer_size_in_bytes == rhs.file_footer_size_in_bytes &&
7873
lhs.blob_metadata == rhs.blob_metadata;
7974
}
80-
81-
/// \brief Compare two StatisticsFiles for inequality.
82-
friend bool operator!=(const StatisticsFile& lhs, const StatisticsFile& rhs) {
83-
return !(lhs == rhs);
84-
}
8575
};
8676

8777
/// \brief Represents a partition statistics file
@@ -100,12 +90,6 @@ struct ICEBERG_EXPORT PartitionStatisticsFile {
10090
return lhs.snapshot_id == rhs.snapshot_id && lhs.path == rhs.path &&
10191
lhs.file_size_in_bytes == rhs.file_size_in_bytes;
10292
}
103-
104-
/// \brief Compare two PartitionStatisticsFiles for inequality.
105-
friend bool operator!=(const PartitionStatisticsFile& lhs,
106-
const PartitionStatisticsFile& rhs) {
107-
return !(lhs == rhs);
108-
}
10993
};
11094

11195
/// \brief Returns a string representation of a BlobMetadata

src/iceberg/table_metadata.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ struct ICEBERG_EXPORT SnapshotLogEntry {
4444
friend bool operator==(const SnapshotLogEntry& lhs, const SnapshotLogEntry& rhs) {
4545
return lhs.timestamp_ms == rhs.timestamp_ms && lhs.snapshot_id == rhs.snapshot_id;
4646
}
47-
48-
friend bool operator!=(const SnapshotLogEntry& lhs, const SnapshotLogEntry& rhs) {
49-
return !(lhs == rhs);
50-
}
5147
};
5248

5349
/// \brief Represents a metadata log entry
@@ -60,10 +56,6 @@ struct ICEBERG_EXPORT MetadataLogEntry {
6056
friend bool operator==(const MetadataLogEntry& lhs, const MetadataLogEntry& rhs) {
6157
return lhs.timestamp_ms == rhs.timestamp_ms && lhs.metadata_file == rhs.metadata_file;
6258
}
63-
64-
friend bool operator!=(const MetadataLogEntry& lhs, const MetadataLogEntry& rhs) {
65-
return !(lhs == rhs);
66-
}
6759
};
6860

6961
/// \brief Represents the metadata for an Iceberg table
@@ -137,10 +129,6 @@ struct ICEBERG_EXPORT TableMetadata {
137129
Result<std::shared_ptr<SortOrder>> SortOrder() const;
138130

139131
friend bool operator==(const TableMetadata& lhs, const TableMetadata& rhs);
140-
141-
friend bool operator!=(const TableMetadata& lhs, const TableMetadata& rhs) {
142-
return !(lhs == rhs);
143-
}
144132
};
145133

146134
/// \brief Returns a string representation of a SnapshotLogEntry

src/iceberg/transform.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,6 @@ class ICEBERG_EXPORT Transform : public util::Formattable {
135135
return lhs.Equals(rhs);
136136
}
137137

138-
/// \brief Inequality comparison.
139-
friend bool operator!=(const Transform& lhs, const Transform& rhs) {
140-
return !(lhs == rhs);
141-
}
142-
143138
private:
144139
/// \brief Constructs a Transform of the specified type (for non-parametric types).
145140
/// \param transform_type The transform type (e.g., identity, year, day).
@@ -188,10 +183,6 @@ class ICEBERG_EXPORT TransformFunction {
188183
return lhs.Equals(rhs);
189184
}
190185

191-
friend bool operator!=(const TransformFunction& lhs, const TransformFunction& rhs) {
192-
return !(lhs == rhs);
193-
}
194-
195186
private:
196187
/// \brief Compare two partition specs for equality.
197188
[[nodiscard]] virtual bool Equals(const TransformFunction& other) const;

0 commit comments

Comments
 (0)