mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Serialization code improvements:
* Add generics to eliminate duplicate code in STHash * Use generics in Serializer and callers
This commit is contained in:
committed by
Vinnie Falco
parent
9fb09d3109
commit
418638ad16
@@ -236,7 +236,8 @@ public:
|
||||
if (rf->getSType () == STI_NOTPRESENT)
|
||||
rf = makeFieldPresent (field);
|
||||
|
||||
if (auto cf = dynamic_cast<STHash160*> (rf))
|
||||
using Bits = STBitString<160>;
|
||||
if (auto cf = dynamic_cast<Bits*> (rf))
|
||||
cf->setValue (v);
|
||||
else
|
||||
throw std::runtime_error ("Wrong field type");
|
||||
|
||||
Reference in New Issue
Block a user