|
Ran
|
Jobs
1
|
Files
130
|
Run time
1min
|
Badge
README BADGES
|
push
github
Merge rust-bitcoin/rust-bitcoin#4348: refactor: Replace fold with try_fold <a class=hub.com/rust-bitcoin/rust-bitcoin/commit/<a class="double-link" href="https://git"><a class=hub.com/rust-bitcoin/rust-bitcoin/commit/812c21e2e4a868046b44728c1a6209a866452820">812c21e2e refactor: Replace fold with try_fold (yancy) Pull request description: The and_then combinator performs a kind of bitwise and operation on two Option types here. This is useful since the `checked` arithmetic returns an option thereby accumulating Option types. Therefore, either the checked arithmetic operation performs the addition of the unwrapped accumulator, or it returns None. Instead of using `and_then` use the provided `try_fold` method which will short circuit on `None` when the checked arithmetic is used. Also, simplify the staring condition using `Amount:ZERO` since this is logically equivalent to using the first value if one exists. Lastly, by using the built in `try_fold`, it's possible the performance will be improved by making use of the short circuit ability instead of evaluating each item even when the accumulator holds a None type. ACKs for top commit: apoelstra: ACK 812c21e2e4a868046b44728c1a6209a866452820; successfully ran local tests tcharding: ACK 812c21e2e4a868046b44728c1a6209a866452820 Tree-SHA512: 1cfcd4fa2a36f747cbcca107829d1f6df83
2 of 2 new or added lines in 1 file covered. (100.0%)
22366 of 26688 relevant lines covered (83.81%)
16668.09 hits per line
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 14494548192.1 | 130 |
83.81 |
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|