mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-11 05:03:16 +01:00
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}.
This commit is contained in:
@@ -81,7 +81,7 @@ GCSFilter::GCSFilter(const Params& params)
|
||||
GCSFilter::GCSFilter(const Params& params, std::vector<unsigned char> encoded_filter)
|
||||
: m_params(params), m_encoded(std::move(encoded_filter))
|
||||
{
|
||||
SpanReader stream{GCS_SER_TYPE, GCS_SER_VERSION, m_encoded, 0};
|
||||
SpanReader stream{GCS_SER_TYPE, GCS_SER_VERSION, m_encoded};
|
||||
|
||||
uint64_t N = ReadCompactSize(stream);
|
||||
m_N = static_cast<uint32_t>(N);
|
||||
@@ -133,7 +133,7 @@ GCSFilter::GCSFilter(const Params& params, const ElementSet& elements)
|
||||
|
||||
bool GCSFilter::MatchInternal(const uint64_t* element_hashes, size_t size) const
|
||||
{
|
||||
SpanReader stream{GCS_SER_TYPE, GCS_SER_VERSION, m_encoded, 0};
|
||||
SpanReader stream{GCS_SER_TYPE, GCS_SER_VERSION, m_encoded};
|
||||
|
||||
// Seek forward by size of N
|
||||
uint64_t N = ReadCompactSize(stream);
|
||||
|
||||
Reference in New Issue
Block a user