refactor: use east const convention (#5409)

This change refactors the codebase to use the "east const convention", and adds a clang-format rule to follow this convention.
This commit is contained in:
Vito Tumas
2025-05-08 13:00:42 +02:00
committed by GitHub
parent 2db2791805
commit 3e152fec74
212 changed files with 812 additions and 795 deletions

View File

@@ -40,7 +40,7 @@ STBase::STBase(SField const& n) : fName(&n)
}
STBase&
STBase::operator=(const STBase& t)
STBase::operator=(STBase const& t)
{
if (!fName->isUseful())
fName = t.fName;
@@ -48,13 +48,13 @@ STBase::operator=(const STBase& t)
}
bool
STBase::operator==(const STBase& t) const
STBase::operator==(STBase const& t) const
{
return (getSType() == t.getSType()) && isEquivalent(t);
}
bool
STBase::operator!=(const STBase& t) const
STBase::operator!=(STBase const& t) const
{
return (getSType() != t.getSType()) || !isEquivalent(t);
}
@@ -116,7 +116,7 @@ STBase::add(Serializer& s) const
}
bool
STBase::isEquivalent(const STBase& t) const
STBase::isEquivalent(STBase const& t) const
{
XRPL_ASSERT(
getSType() == STI_NOTPRESENT,
@@ -154,7 +154,7 @@ STBase::addFieldID(Serializer& s) const
//------------------------------------------------------------------------------
std::ostream&
operator<<(std::ostream& out, const STBase& t)
operator<<(std::ostream& out, STBase const& t)
{
return out << t.getFullText();
}