mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-16 00:55:49 +00:00
Remove const_cast usage
This commit is contained in:
committed by
manojsdoshi
parent
04ef885108
commit
23ce431876
@@ -88,13 +88,10 @@ computeBookChanges(std::shared_ptr<L const> const& lpAccepted)
|
||||
!node.isFieldPresent(sfPreviousFields))
|
||||
continue;
|
||||
|
||||
STObject& finalFields = (const_cast<STObject&>(node))
|
||||
.getField(sfFinalFields)
|
||||
.downcast<STObject>();
|
||||
|
||||
STObject& previousFields = (const_cast<STObject&>(node))
|
||||
.getField(sfPreviousFields)
|
||||
.downcast<STObject>();
|
||||
auto const& ffBase = node.peekAtField(sfFinalFields);
|
||||
auto const& finalFields = ffBase.template downcast<STObject>();
|
||||
auto const& pfBase = node.peekAtField(sfPreviousFields);
|
||||
auto const& previousFields = pfBase.template downcast<STObject>();
|
||||
|
||||
// defensive case that should never be hit
|
||||
if (!finalFields.isFieldPresent(sfTakerGets) ||
|
||||
|
||||
Reference in New Issue
Block a user