diff options
author | fanquake <fanquake@gmail.com> | 2023-08-04 13:35:34 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-08-04 14:50:49 +0200 |
commit | f138422d37ba79e6ab0edf8f459581f1243fba08 (patch) | |
tree | 46f1eb0b635827855bfb1121ee86cb39b6dc5333 /src/util/translation.h | |
parent | a4ca4975880c4f870c6047065c70610af2529e74 (diff) | |
parent | f054bd072afb72d8dae7adc521ce15c13b236700 (diff) |
Merge bitcoin/bitcoin#28203: refactor: serialization simplifications
f054bd072afb72d8dae7adc521ce15c13b236700 refactor: use "if constexpr" in std::vector's Unserialize() (Martin Leitner-Ankerl)
088caa68fb8efd8624709d643913b8a7e1218f8a refactor: use "if constexpr" in std::vector's Serialize() (Martin Leitner-Ankerl)
0fafaca4d3bbf0c0b5bfe1ec617ab15252ea51e6 refactor: use "if constexpr" in prevector's Unserialize() (Martin Leitner-Ankerl)
c8839ec5cd81ba9ae88081747c49ecc758973dd1 refactor: use "if constexpr" in prevector's Serialize() (Martin Leitner-Ankerl)
1403d181c106bc271ad2522adebde07c7850069b refactor: use fold expressions instead of recursive calls in UnserializeMany() (Martin Leitner-Ankerl)
bd08a008b42dac921bd9c031637e378899c1cd1d refactor: use fold expressions instead of recursive calls in SerializeMany() (Martin Leitner-Ankerl)
Pull request description:
This simplifies the serialization code a bit and should also make it a bit faster.
* use fold expressions instead of recursive calls. This simplifies the code, makes it most likely faster because it reduces the number of function calls, and compiles faster because there are fewer template instantiations.
* use `if constexpr` instead of unnecessarily creating a temporary object only to call the right overload. This is used for `std::vector` and `prevector` serialization.
ACKs for top commit:
MarcoFalke:
only change is to add a missing `&`. lgtm, re-ACK f054bd072afb72d8dae7adc521ce15c13b236700 📦
jonatack:
ACK f054bd072afb72d8dae7adc521ce15c13b236700
sipa:
utACK f054bd072afb72d8dae7adc521ce15c13b236700
john-moffett:
ACK f054bd072afb72d8dae7adc521ce15c13b236700
Tree-SHA512: 0417bf2d6be486c581732297945449211fc3481bac82964e27628b38ef55a47dfa58d730148aeaf1b19fa8eb1076489cc646ceebb178162a9afa59034601501d
Diffstat (limited to 'src/util/translation.h')
0 files changed, 0 insertions, 0 deletions