diff options
author | Andrew Chow <github@achow101.com> | 2023-06-28 15:01:51 -0400 |
---|---|---|
committer | Andrew Chow <github@achow101.com> | 2023-06-28 15:12:12 -0400 |
commit | 7952a5934a1e071ca24a51483d058174e7b6de43 (patch) | |
tree | 61bfba21a02058c7abb221736095932f4f2ff738 /src/bench | |
parent | d6ee03507f39223889a5f039c4db7204ddfb91d5 (diff) | |
parent | fa38d862358b87219b12bf31236c52f28d9fc5d6 (diff) |
Merge bitcoin/bitcoin#27927: util: Allow std::byte and char Span serialization
fa38d862358b87219b12bf31236c52f28d9fc5d6 Use only Span{} constructor for byte-like types where possible (MarcoFalke)
fa257bc8312b91c2d281f48ca2500d9cba353cc5 util: Allow std::byte and char Span serialization (MarcoFalke)
Pull request description:
Seems odd to require developers to cast all byte-like spans passed to serialization to `unsigned char`-spans. Fix that by passing and accepting byte-like spans as-is. Finally, add tests and update the code to use just `Span` where possible.
ACKs for top commit:
sipa:
utACK fa38d862358b87219b12bf31236c52f28d9fc5d6
achow101:
ACK fa38d862358b87219b12bf31236c52f28d9fc5d6
ryanofsky:
Code review ACK fa38d862358b87219b12bf31236c52f28d9fc5d6. This looks great. The second commit really removes a lot of boilerplate and shows why the first commit is useful.
Tree-SHA512: 788592d9ff515c3ebe73d48f9ecbb8d239f5b985af86f09974e508cafb0ca6d73a959350295246b4dfb496149bc56330a0b5d659fc434ba6723dbaba0b7a49e5
Diffstat (limited to 'src/bench')
-rw-r--r-- | src/bench/load_external.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bench/load_external.cpp b/src/bench/load_external.cpp index 2ff72a3012..1378a7b20a 100644 --- a/src/bench/load_external.cpp +++ b/src/bench/load_external.cpp @@ -34,7 +34,7 @@ static void LoadExternalBlockFile(benchmark::Bench& bench) ss << static_cast<uint32_t>(benchmark::data::block413567.size()); // We can't use the streaming serialization (ss << benchmark::data::block413567) // because that first writes a compact size. - ss.write(MakeByteSpan(benchmark::data::block413567)); + ss << Span{benchmark::data::block413567}; // Create the test file. { |