Skip to content

Commit

Permalink
Address reviewer's feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
gregtatcam committed Dec 11, 2024
1 parent cc4a9c0 commit 10ffdf1
Showing 1 changed file with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions include/xrpl/protocol/STIssue.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ class STIssue final : public STBase, CountedObject<STIssue>
bool
isDefault() const override;

friend constexpr std::weak_ordering
operator<=>(STIssue const& lhs, STIssue const& rhs);

friend constexpr bool
operator==(STIssue const& lhs, Asset const& rhs);

friend constexpr std::weak_ordering
operator<=>(STIssue const& lhs, Asset const& rhs);

private:
STBase*
copy(std::size_t n, void* buf) const override;
Expand Down Expand Up @@ -129,34 +138,22 @@ STIssue::setIssue(Asset const& asset)
asset_ = asset;
}

inline bool
operator==(STIssue const& lhs, STIssue const& rhs)
{
return lhs.value() == rhs.value();
}

inline bool
operator!=(STIssue const& lhs, STIssue const& rhs)
{
return !operator==(lhs, rhs);
}

inline bool
operator<(STIssue const& lhs, STIssue const& rhs)
constexpr std::weak_ordering
operator<=>(STIssue const& lhs, STIssue const& rhs)
{
return lhs.value() < rhs.value();
return lhs.asset_ <=> rhs.asset_;
}

inline bool
constexpr bool
operator==(STIssue const& lhs, Asset const& rhs)
{
return lhs.value() == rhs;
return lhs.asset_ == rhs;
}

inline bool
operator<(STIssue const& lhs, Asset const& rhs)
constexpr std::weak_ordering
operator<=>(STIssue const& lhs, Asset const& rhs)
{
return lhs.value() < rhs;
return lhs.asset_ <=> rhs;
}

} // namespace ripple
Expand Down

0 comments on commit 10ffdf1

Please sign in to comment.