Skip to content

Conversation

sipa
Copy link
Member

@sipa sipa commented Dec 6, 2021

This removes the ability to set an offset in the SpanReader::SpanReader constructor, as the current code is broken since #23653. 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 was pointed out by achow101 in #23653 (comment).

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}.
@sipa sipa force-pushed the 202112_spanreadernopos branch from 0045b56 to 31ba1af Compare December 6, 2021 21:18
@DrahtBot DrahtBot added the Wallet label Dec 6, 2021
Copy link
Contributor

@jb55 jb55 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crACK 31ba1af

@fanquake fanquake requested review from maflcko and achow101 December 7, 2021 01:04
Copy link
Member

@achow101 achow101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 31ba1af

@maflcko maflcko merged commit b7e6330 into bitcoin:master Dec 7, 2021
Copy link
Contributor

@shaavan shaavan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Post merge ACK 31ba1af

sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Dec 7, 2021
…Reader

31ba1af Remove unused (and broken) functionality in SpanReader (Pieter Wuille)

Pull request description:

  This removes the ability to set an offset in the `SpanReader::SpanReader` constructor, as the current code is broken since bitcoin#23653. 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 was pointed out by achow101 in bitcoin#23653 (comment).

ACKs for top commit:
  jb55:
    crACK 31ba1af
  achow101:
    ACK 31ba1af

Tree-SHA512: 700ebcd74147628488c39168dbf3a00f8ed41709a26711695f4bf036250a9b115574923bbf96040ec7b7fee4132d6dbbcb5c6e5a2977c4beb521dc1500e6ed53
Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Posthumous utACK 31ba1af

RandyMcMillan pushed a commit to RandyMcMillan/mempool-tab that referenced this pull request Dec 23, 2021
… in SpanReader

9f98adf Remove unused (and broken) functionality in SpanReader (Pieter Wuille)

Pull request description:

  This removes the ability to set an offset in the `SpanReader::SpanReader` constructor, as the current code is broken since #23653. 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 was pointed out by achow101 in bitcoin/bitcoin#23653 (comment).

ACKs for top commit:
  jb55:
    crACK 9f98adf
  achow101:
    ACK 9f98adf

Tree-SHA512: 700ebcd74147628488c39168dbf3a00f8ed41709a26711695f4bf036250a9b115574923bbf96040ec7b7fee4132d6dbbcb5c6e5a2977c4beb521dc1500e6ed53
@bitcoin bitcoin locked and limited conversation to collaborators Dec 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants