Skip to content

Commit 255d5dc

Browse files
committed
refactor: remove unnecessary nodiscard attributes
1 parent 622a934 commit 255d5dc

File tree

6 files changed

+25
-26
lines changed

6 files changed

+25
-26
lines changed

src/iceberg/partition_field.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class ICEBERG_EXPORT PartitionField : public util::Formattable {
6464

6565
private:
6666
/// \brief Compare two fields for equality.
67-
[[nodiscard]] bool Equals(const PartitionField& other) const;
67+
bool Equals(const PartitionField& other) const;
6868

6969
int32_t source_id_;
7070
int32_t field_id_;

src/iceberg/partition_spec.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class ICEBERG_EXPORT PartitionSpec : public util::Formattable {
7777

7878
private:
7979
/// \brief Compare two partition specs for equality.
80-
[[nodiscard]] bool Equals(const PartitionSpec& other) const;
80+
bool Equals(const PartitionSpec& other) const;
8181

8282
std::shared_ptr<Schema> schema_;
8383
const int32_t spec_id_;

src/iceberg/schema_field.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,29 +56,29 @@ class ICEBERG_EXPORT SchemaField : public iceberg::util::Formattable {
5656
std::shared_ptr<Type> type, std::string doc = {});
5757

5858
/// \brief Get the field ID.
59-
[[nodiscard]] int32_t field_id() const;
59+
int32_t field_id() const;
6060

6161
/// \brief Get the field name.
62-
[[nodiscard]] std::string_view name() const;
62+
std::string_view name() const;
6363

6464
/// \brief Get the field type.
65-
[[nodiscard]] const std::shared_ptr<Type>& type() const;
65+
const std::shared_ptr<Type>& type() const;
6666

6767
/// \brief Get whether the field is optional.
68-
[[nodiscard]] bool optional() const;
68+
bool optional() const;
6969

7070
/// \brief Get the field documentation.
7171
std::string_view doc() const;
7272

73-
[[nodiscard]] std::string ToString() const override;
73+
std::string ToString() const override;
7474

7575
friend bool operator==(const SchemaField& lhs, const SchemaField& rhs) {
7676
return lhs.Equals(rhs);
7777
}
7878

7979
private:
8080
/// \brief Compare two fields for equality.
81-
[[nodiscard]] bool Equals(const SchemaField& other) const;
81+
bool Equals(const SchemaField& other) const;
8282

8383
int32_t field_id_;
8484
std::string name_;

src/iceberg/sort_field.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class ICEBERG_EXPORT SortField : public util::Formattable {
115115

116116
private:
117117
/// \brief Compare two fields for equality.
118-
[[nodiscard]] bool Equals(const SortField& other) const;
118+
bool Equals(const SortField& other) const;
119119

120120
int32_t source_id_;
121121
std::shared_ptr<Transform> transform_;

src/iceberg/transform.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ class ICEBERG_EXPORT Transform : public util::Formattable {
169169
Transform(TransformType transform_type, int32_t param);
170170

171171
/// \brief Checks equality with another Transform instance.
172-
[[nodiscard]] virtual bool Equals(const Transform& other) const;
172+
virtual bool Equals(const Transform& other) const;
173173

174174
TransformType transform_type_;
175175
/// Optional parameter (e.g., num_buckets, width)
@@ -210,7 +210,7 @@ class ICEBERG_EXPORT TransformFunction {
210210

211211
private:
212212
/// \brief Compare two partition specs for equality.
213-
[[nodiscard]] virtual bool Equals(const TransformFunction& other) const;
213+
virtual bool Equals(const TransformFunction& other) const;
214214

215215
TransformType transform_type_;
216216
std::shared_ptr<Type> source_type_;

src/iceberg/type.h

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,20 @@ class ICEBERG_EXPORT Type : public iceberg::util::Formattable {
5353
~Type() override = default;
5454

5555
/// \brief Get the type ID.
56-
[[nodiscard]] virtual TypeId type_id() const = 0;
56+
virtual TypeId type_id() const = 0;
5757

5858
/// \brief Is this a primitive type (may not have child fields)?
59-
[[nodiscard]] virtual bool is_primitive() const = 0;
59+
virtual bool is_primitive() const = 0;
6060

6161
/// \brief Is this a nested type (may have child fields)?
62-
[[nodiscard]] virtual bool is_nested() const = 0;
62+
virtual bool is_nested() const = 0;
6363

6464
/// \brief Compare two types for equality.
6565
friend bool operator==(const Type& lhs, const Type& rhs) { return lhs.Equals(rhs); }
6666

6767
protected:
6868
/// \brief Compare two types for equality.
69-
[[nodiscard]] virtual bool Equals(const Type& other) const = 0;
69+
virtual bool Equals(const Type& other) const = 0;
7070
};
7171

7272
/// \brief A data type that does not have child fields.
@@ -83,28 +83,27 @@ class ICEBERG_EXPORT NestedType : public Type {
8383
bool is_nested() const override { return true; }
8484

8585
/// \brief Get a view of the child fields.
86-
[[nodiscard]] virtual std::span<const SchemaField> fields() const = 0;
86+
virtual std::span<const SchemaField> fields() const = 0;
8787
using SchemaFieldConstRef = std::reference_wrapper<const SchemaField>;
8888
/// \brief Get a field by field ID.
8989
///
9090
/// \note This is O(1) complexity.
91-
[[nodiscard]] virtual Result<std::optional<SchemaFieldConstRef>> GetFieldById(
91+
virtual Result<std::optional<SchemaFieldConstRef>> GetFieldById(
9292
int32_t field_id) const = 0;
9393
/// \brief Get a field by index.
9494
///
9595
/// \note This is O(1) complexity.
96-
[[nodiscard]] virtual Result<std::optional<SchemaFieldConstRef>> GetFieldByIndex(
96+
virtual Result<std::optional<SchemaFieldConstRef>> GetFieldByIndex(
9797
int32_t index) const = 0;
9898
/// \brief Get a field by name. Return an error Status if
9999
/// the field name is not unique; prefer GetFieldById or GetFieldByIndex
100100
/// when possible.
101101
///
102102
/// \note This is O(1) complexity.
103-
[[nodiscard]] virtual Result<std::optional<SchemaFieldConstRef>> GetFieldByName(
103+
virtual Result<std::optional<SchemaFieldConstRef>> GetFieldByName(
104104
std::string_view name, bool case_sensitive) const = 0;
105105
/// \brief Get a field by name (case-sensitive).
106-
[[nodiscard]] Result<std::optional<SchemaFieldConstRef>> GetFieldByName(
107-
std::string_view name) const;
106+
Result<std::optional<SchemaFieldConstRef>> GetFieldByName(std::string_view name) const;
108107
};
109108

110109
/// \defgroup type-nested Nested Types
@@ -305,10 +304,10 @@ class ICEBERG_EXPORT DecimalType : public PrimitiveType {
305304
~DecimalType() override = default;
306305

307306
/// \brief Get the precision (the number of decimal digits).
308-
[[nodiscard]] int32_t precision() const;
307+
int32_t precision() const;
309308
/// \brief Get the scale (essentially, the number of decimal digits after
310309
/// the decimal point; precisely, the value is scaled by $$10^{-s}$$.).
311-
[[nodiscard]] int32_t scale() const;
310+
int32_t scale() const;
312311

313312
TypeId type_id() const override;
314313
std::string ToString() const override;
@@ -358,9 +357,9 @@ class ICEBERG_EXPORT TimeType : public PrimitiveType {
358357
class ICEBERG_EXPORT TimestampBase : public PrimitiveType {
359358
public:
360359
/// \brief Is this type zoned or naive?
361-
[[nodiscard]] virtual bool is_zoned() const = 0;
360+
virtual bool is_zoned() const = 0;
362361
/// \brief The time resolution.
363-
[[nodiscard]] virtual TimeUnit time_unit() const = 0;
362+
virtual TimeUnit time_unit() const = 0;
364363
};
365364

366365
/// \brief A data type representing a timestamp in microseconds without
@@ -442,7 +441,7 @@ class ICEBERG_EXPORT FixedType : public PrimitiveType {
442441
~FixedType() override = default;
443442

444443
/// \brief The length (the number of bytes to store).
445-
[[nodiscard]] int32_t length() const;
444+
int32_t length() const;
446445

447446
TypeId type_id() const override;
448447
std::string ToString() const override;

0 commit comments

Comments
 (0)