-
Notifications
You must be signed in to change notification settings - Fork 38.7k
refactor: Make CScriptVisitor stateless #18863
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
|
@sipa mind taking a look since you wrote this code? |
|
All of this code will go away anyway when we switch to C++17 in 5 months, except for the ACK on changing |
|
ACK ae0891e87b0aa0ce57a77dbd99555803a539d6ea, reviewed first commit with --word-diff and second commit with --word-diff-regex=. 🌲 Show signature and timestampSignature: Timestamp of file with hash |
|
Concept ACK |
|
Open-Close to re-run ci. See #15847 (comment) |
When a change is closed and re-opened then the compute of changes opened + merged + abandoned != changes created. It was due to the compute method that was based on the events but not on the status of the change. Example of change: bitcoin/bitcoin#18863
|
@sipa friendly ping. |
|
utACK ae0891e87b0aa0ce57a77dbd99555803a539d6ea It could be made even shorter using |
ae0891e to
2102f20
Compare
Done. |
2102f20 to
1eb7393
Compare
|
ACK 1eb73933399dc8d9ff536fa668a98b03bd7d597b 🎰 Show signature and timestampSignature: Timestamp of file with hash |
|
utACK the current code. Another suggestion - and feel free to ignore - given that the return type bool is now gone, why not use it for the script itself? The return type could be CScript directly. |
1eb7393 to
3351c91
Compare
|
Yeah I saw it too - previous change made it obvious - but was lazy to do it. Updated, looks better. |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
|
@MarcoFalke @sipa should be an easy review. |
|
ACK 3351c91 🏤 Show signature and timestampSignature: Timestamp of file with hash |
|
@sipa ping. |
|
utACK 3351c91 |
| } | ||
| }; | ||
|
|
||
| const CScriptVisitor g_script_visitor; |
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.
nit: function-scope globals are better than anon-scope globals, but all this code will go away with C++17, so no big deal
3351c91 refactor: Make CScriptVisitor stateless (João Barbosa) Pull request description: `CScriptVisitor` was added in 1025440 (bitcoin#1357) and the visitor return type was never used. Now `CScriptVisitor` is stateless and `CScript` is the return type. ACKs for top commit: MarcoFalke: ACK 3351c91 🏤 sipa: utACK 3351c91 Tree-SHA512: d158ad2ebe8ea4dc8cc090b943dd66fa5421a84f9443e16ab2d661df38e1a85de16ff13cbaa56924489d8d43cba25fa3cd8b6904bbbcbf356b886ffe8ffba19a
Summary: > CScriptVisitor was added in [[bitcoin/bitcoin#1357 | core#1357]] and the visitor return type was never used. Now CScriptVisitor is stateless and CScript is the return type. This is a backport of [[bitcoin/bitcoin#18863 | core#18863]] Test Plan: `ninja all check-all` Reviewers: #bitcoin_abc, majcosta Reviewed By: #bitcoin_abc, majcosta Differential Revision: https://reviews.bitcoinabc.org/D9939
CScriptVisitorwas added in 1025440 (#1357) and the visitor return type was never used. NowCScriptVisitoris stateless andCScriptis the return type.