Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
519cf98b
Unverified
Commit
519cf98b
authored
Nov 25, 2021
by
Andrei Maiboroda
Committed by
GitHub
Nov 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/vm: simplify op lookup in contract (#23974)
parent
4ebeca19
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
7 deletions
+2
-7
contract.go
core/vm/contract.go
+2
-7
No files found.
core/vm/contract.go
View file @
519cf98b
...
...
@@ -143,16 +143,11 @@ func (c *Contract) AsDelegate() *Contract {
// GetOp returns the n'th element in the contract's byte array
func
(
c
*
Contract
)
GetOp
(
n
uint64
)
OpCode
{
return
OpCode
(
c
.
GetByte
(
n
))
}
// GetByte returns the n'th byte in the contract's byte array
func
(
c
*
Contract
)
GetByte
(
n
uint64
)
byte
{
if
n
<
uint64
(
len
(
c
.
Code
))
{
return
c
.
Code
[
n
]
return
OpCode
(
c
.
Code
[
n
])
}
return
0
return
STOP
}
// Caller returns the caller of the contract.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment