Skip to content

Commit

Permalink
Make == const
Browse files Browse the repository at this point in the history
  • Loading branch information
gregtatcam committed Jul 16, 2024
1 parent 6f664e4 commit 4e4352f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions include/xrpl/protocol/STMPTAmount.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,20 @@ class STMPTAmount final : public MPTAmount,
signum() const noexcept;

bool
operator==(STMPTAmount const& rhs);
operator==(STMPTAmount const& rhs) const;

bool
operator!=(STMPTAmount const& rhs);
operator!=(STMPTAmount const& rhs) const;
};

inline bool
STMPTAmount::operator==(STMPTAmount const& rhs)
STMPTAmount::operator==(STMPTAmount const& rhs) const
{
return value_ == rhs.value_ && issue_ == rhs.issue_;
}

inline bool
STMPTAmount::operator!=(STMPTAmount const& rhs)
STMPTAmount::operator!=(STMPTAmount const& rhs) const
{
return !operator==(rhs);
}
Expand Down
2 changes: 1 addition & 1 deletion src/libxrpl/protocol/STMPTAmount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ bool
STMPTAmount::isEquivalent(const STBase& t) const
{
const STMPTAmount* v = dynamic_cast<const STMPTAmount*>(&t);
return v && (*v == *this);
return v && operator == (*v);
}

bool
Expand Down

0 comments on commit 4e4352f

Please sign in to comment.