-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Craetes a function to get the max size for abi.Argumetns, given any outermost slices have N elements #11259
Conversation
I see that you haven't updated any CHANGELOG files. Would it make sense to do so? |
cc85045
to
584424a
Compare
584424a
to
985619a
Compare
38a06f9
to
17bd691
Compare
985619a
to
563b404
Compare
17bd691
to
786c2d4
Compare
563b404
to
917ecec
Compare
786c2d4
to
2039176
Compare
0389024
to
cd92e54
Compare
2039176
to
85f0a93
Compare
cd92e54
to
17fe123
Compare
85f0a93
to
549ba37
Compare
549ba37
to
712a010
Compare
return size, nil | ||
} | ||
|
||
func getTypeSize(n int, t *abi.Type, dynamicTypeAllowed bool, isNested bool) (int, bool, error) { |
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, why is abi.Type a pointer? Can't we just make this not a ptr and then not use tmp var in GetMaxSize
?
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.
It's often returned as one, so I figured why bother having the struct copied by value
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.
wdym, why would you copy it by value? If you pass a dereferenced arg.Type
into getTypeSize()
you get the same effect as if you passed &tmp in. Non pointer attributes inside of the struct won't get changed and attributes with a pointer would get changed either way.
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.
See below, t.Elm is passed in on line 27, it's naturally a pointer. When you pass a struct directly, you force a copy of that struct to be made.
712a010
to
327534f
Compare
…utermost slices have N elements
327534f
to
1690e14
Compare
SonarQube Quality Gate |
No description provided.