Skip to content
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

core/vm: Simplify Contract.GetByte function #23974

Merged
merged 1 commit into from
Nov 25, 2021

Conversation

gumb0
Copy link
Member

@gumb0 gumb0 commented Nov 25, 2021

Small cleanup to remove unneed extra helper + use STOP literal instead of 0.

}

return 0
return STOP
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps a comment could help:

Suggested change
return STOP
// Reading over code is defined to return the byte 0, which is the STOP instruction
return STOP

@gumb0 gumb0 marked this pull request as ready for review November 25, 2021 14:48
Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

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

LGTM!

I had an identical branch which I was going to PR, but then I looked at the decompilation of the interpreter, and found that it was no practical difference at all, so I didn't bother. Nevertheless, less code is better

@holiman holiman added this to the 1.10.14 milestone Nov 25, 2021
@holiman holiman merged commit 519cf98 into ethereum:master Nov 25, 2021
@axic axic deleted the simplify-getop branch November 25, 2021 19:18
sidhujag pushed a commit to syscoin/go-ethereum that referenced this pull request Nov 26, 2021
JacekGlen pushed a commit to JacekGlen/go-ethereum that referenced this pull request May 26, 2022
yperbasis added a commit to erigontech/erigon that referenced this pull request Dec 19, 2022
Cherry-pick ethereum/go-ethereum#23974

Co-authored-by: Andrei Maiboroda <andrei@ethereum.org>
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants