Commit 56d4bca
committed
Merge rust-bitcoin#5417: optimize(block): avoid cloning when encoding unchecked blocks
f26ddba Use as_parts to encode Block<Unchecked> without cloning (Alkamal01)
Pull request description:
Removes an unnecessary clone in `Block<Unchecked>` encoding.
Based on review feedback, this adds `as_parts` to `Block<Unchecked>` instead of introducing new getters. That lets us encode without cloning while keeping the API stable for the 1.0 release.
ACKs for top commit:
tcharding:
ACK f26ddba
apoelstra:
ACK f26ddba; successfully ran local tests
Tree-SHA512: 224dbb6dd8e87ade12c0c2e70257d04710d09a06fae028118beef53ffd88d98b6ab8d70d6cad484514f07043c9072320b49fd23605b1769cbece76566a8ab7ee4 files changed
Lines changed: 14 additions & 4 deletions
File tree
- api/primitives
- bitcoin/src/blockdata
- primitives/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1465 | 1465 | | |
1466 | 1466 | | |
1467 | 1467 | | |
| 1468 | + | |
1468 | 1469 | | |
1469 | 1470 | | |
1470 | 1471 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1276 | 1276 | | |
1277 | 1277 | | |
1278 | 1278 | | |
| 1279 | + | |
1279 | 1280 | | |
1280 | 1281 | | |
1281 | 1282 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
243 | 247 | | |
244 | 248 | | |
245 | 249 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
116 | 120 | | |
117 | 121 | | |
118 | 122 | | |
| |||
0 commit comments