From 31ba1af74a0aaec690a01ea061264a6d5039d885 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 6 Dec 2021 15:45:38 -0500 Subject: Remove unused (and broken) functionality in SpanReader This removes the ability to set an offset in the SpanReader constructor, as the current code is broken. All call sites use pos=0, so it is actually unused. If future call sites need it, SpanReader{a, b, c, d} is equivalent to SpanReader{a, b, c.subspan(d)}. It also removes the ability to deserialize from SpanReader directly from the constructor. This too is unused, and can be more idiomatically simulated using (SpanReader{a, b, c} >> x >> y >> z) instead of SpanReader{a, b, c, x, y, z}. --- src/test/fuzz/golomb_rice.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/test/fuzz/golomb_rice.cpp') diff --git a/src/test/fuzz/golomb_rice.cpp b/src/test/fuzz/golomb_rice.cpp index 7b4634c67b..746347ac95 100644 --- a/src/test/fuzz/golomb_rice.cpp +++ b/src/test/fuzz/golomb_rice.cpp @@ -82,7 +82,7 @@ FUZZ_TARGET(golomb_rice) std::vector decoded_deltas; { - SpanReader stream{SER_NETWORK, 0, golomb_rice_data, 0}; + SpanReader stream{SER_NETWORK, 0, golomb_rice_data}; BitStreamReader bitreader{stream}; const uint32_t n = static_cast(ReadCompactSize(stream)); for (uint32_t i = 0; i < n; ++i) { @@ -94,7 +94,7 @@ FUZZ_TARGET(golomb_rice) { const std::vector random_bytes = ConsumeRandomLengthByteVector(fuzzed_data_provider, 1024); - SpanReader stream{SER_NETWORK, 0, random_bytes, 0}; + SpanReader stream{SER_NETWORK, 0, random_bytes}; uint32_t n; try { n = static_cast(ReadCompactSize(stream)); -- cgit v1.2.3