mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-03 16:56:48 +00:00
Add XRPL_ASSERT_IF(guard, ...) to instrumentation.h — a conditional assertion that fires only when guard is true, using __VA_ARGS__ to match the XRPL_ASSERT_PARTS variadic convention and avoid bare-comma pitfalls in cond. guard is always evaluated (even in release builds where the assertion body is stripped), so it should be side-effect-free. Replace all amendment-gated XRPL_ASSERT / XRPL_ASSERT_PARTS call sites in LendingHelpers.cpp and MPTokenHelpers.cpp with the new macro. In doOverpayment, hoist rules.enabled(fixCleanup3_2_0) to a single bool to avoid three repeated set lookups, and inline the three intermediate Number values into a lambda so they are only computed when the guard fires.