mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
chore: Apply clang-format width 100 (#6387)
This commit is contained in:
@@ -41,7 +41,8 @@
|
||||
|
||||
namespace xrpl {
|
||||
|
||||
STObject::STObject(STObject&& other) : STBase(other.getFName()), v_(std::move(other.v_)), mType(other.mType)
|
||||
STObject::STObject(STObject&& other)
|
||||
: STBase(other.getFName()), v_(std::move(other.v_)), mType(other.mType)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -61,7 +62,8 @@ STObject::STObject(SOTemplate const& type, SerialIter& sit, SField const& name)
|
||||
applyTemplate(type); // May throw
|
||||
}
|
||||
|
||||
STObject::STObject(SerialIter& sit, SField const& name, int depth) noexcept(false) : STBase(name), mType(nullptr)
|
||||
STObject::STObject(SerialIter& sit, SField const& name, int depth) noexcept(false)
|
||||
: STBase(name), mType(nullptr)
|
||||
{
|
||||
if (depth > 10)
|
||||
Throw<std::runtime_error>("Maximum nesting depth of STObject exceeded");
|
||||
@@ -83,7 +85,8 @@ STObject::makeInnerObject(SField const& name)
|
||||
if (!rules || (rules->enabled(fixInnerObjTemplate) && isAMMObj) ||
|
||||
(rules->enabled(fixInnerObjTemplate2) && !isAMMObj))
|
||||
{
|
||||
if (SOTemplate const* elements = InnerObjectFormats::getInstance().findSOTemplateBySField(name))
|
||||
if (SOTemplate const* elements =
|
||||
InnerObjectFormats::getInstance().findSOTemplateBySField(name))
|
||||
obj.set(*elements);
|
||||
}
|
||||
return obj;
|
||||
@@ -160,8 +163,9 @@ STObject::applyTemplate(SOTemplate const& type)
|
||||
v.reserve(type.size());
|
||||
for (auto const& e : type)
|
||||
{
|
||||
auto const iter = std::find_if(
|
||||
v_.begin(), v_.end(), [&](detail::STVar const& b) { return b.get().getFName() == e.sField(); });
|
||||
auto const iter = std::find_if(v_.begin(), v_.end(), [&](detail::STVar const& b) {
|
||||
return b.get().getFName() == e.sField();
|
||||
});
|
||||
if (iter != v_.end())
|
||||
{
|
||||
if ((e.style() == soeDEFAULT) && iter->get().isDefault())
|
||||
@@ -236,7 +240,8 @@ STObject::set(SerialIter& sit, int depth)
|
||||
|
||||
if (fn.isInvalid())
|
||||
{
|
||||
JLOG(debugLog().error()) << "Unknown field: field_type=" << type << ", field_name=" << field;
|
||||
JLOG(debugLog().error())
|
||||
<< "Unknown field: field_type=" << type << ", field_name=" << field;
|
||||
Throw<std::runtime_error>("Unknown field");
|
||||
}
|
||||
|
||||
@@ -252,9 +257,10 @@ STObject::set(SerialIter& sit, int depth)
|
||||
// duplicate fields. This is a key invariant:
|
||||
auto const sf = getSortedFields(*this, withAllFields);
|
||||
|
||||
auto const dup = std::adjacent_find(sf.cbegin(), sf.cend(), [](STBase const* lhs, STBase const* rhs) {
|
||||
return lhs->getFName() == rhs->getFName();
|
||||
});
|
||||
auto const dup =
|
||||
std::adjacent_find(sf.cbegin(), sf.cend(), [](STBase const* lhs, STBase const* rhs) {
|
||||
return lhs->getFName() == rhs->getFName();
|
||||
});
|
||||
|
||||
if (dup != sf.cend())
|
||||
Throw<std::runtime_error>("Duplicate field detected");
|
||||
@@ -333,17 +339,19 @@ STObject::isEquivalent(STBase const& t) const
|
||||
|
||||
if (mType != nullptr && v->mType == mType)
|
||||
{
|
||||
return std::equal(begin(), end(), v->begin(), v->end(), [](STBase const& st1, STBase const& st2) {
|
||||
return (st1.getSType() == st2.getSType()) && st1.isEquivalent(st2);
|
||||
});
|
||||
return std::equal(
|
||||
begin(), end(), v->begin(), v->end(), [](STBase const& st1, STBase const& st2) {
|
||||
return (st1.getSType() == st2.getSType()) && st1.isEquivalent(st2);
|
||||
});
|
||||
}
|
||||
|
||||
auto const sf1 = getSortedFields(*this, withAllFields);
|
||||
auto const sf2 = getSortedFields(*v, withAllFields);
|
||||
|
||||
return std::equal(sf1.begin(), sf1.end(), sf2.begin(), sf2.end(), [](STBase const* st1, STBase const* st2) {
|
||||
return (st1->getSType() == st2->getSType()) && st1->isEquivalent(*st2);
|
||||
});
|
||||
return std::equal(
|
||||
sf1.begin(), sf1.end(), sf2.begin(), sf2.end(), [](STBase const* st1, STBase const* st2) {
|
||||
return (st1->getSType() == st2->getSType()) && st1->isEquivalent(*st2);
|
||||
});
|
||||
}
|
||||
|
||||
uint256
|
||||
|
||||
Reference in New Issue
Block a user