mirror of
https://github.com/XRPLF/rippled.git
synced 2026-09-27 15:28:03 +00:00
Addresses bthomee's review suggestion: about a third of isZeroId call sites are the optional-field pattern 'x && isZeroId(*x)'. Add an overload taking std::optional<T> const& and collapse the 5 direct call sites (Payment, LoanSet, LoanBrokerCoverClawback, OfferCreate, PermissionedDomainSet). The remaining if-let uses are left alone because collapsing them would move unrelated code out of the outer block. The negated helpers (!isPositiveAmount etc.) are intentionally not overloaded: with an optional overload, !isPositiveAmount(opt) would be true when the optional is empty, which is the opposite of the existing 'opt && !isPositiveAmount(*opt)' semantics.