-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Remove unused (and broken) functionality in SpanReader #23687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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}.
0045b56 to
31ba1af
Compare
jb55
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
crACK 31ba1af
achow101
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 31ba1af
shaavan
left a comment
There was a problem hiding this 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
…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
jonatack
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Posthumous utACK 31ba1af
… 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
This removes the ability to set an offset in the
SpanReader::SpanReaderconstructor, as the current code is broken since #23653. All call sites usepos=0, so it is actually unused. If future call sites need it,SpanReader{a, b, c, d}is equivalent toSpanReader{a, b, c.subspan(d)}.It also removes the ability to deserialize from
SpanReaderdirectly from the constructor. This too is unused, and can be more idiomatically simulated using(SpanReader{a, b, c} >> x >> y >> z)instead ofSpanReader{a, b, c, x, y, z}.This was pointed out by achow101 in #23653 (comment).