-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
types/int: Switch Int, Uint to use pointers internally #1388
Conversation
This reduces the amount of pointer refs & derefs.
types/int.go
Outdated
@@ -43,6 +47,13 @@ func marshalAmino(i *big.Int) (string, error) { | |||
|
|||
// UnmarshalAmino for custom decoding scheme | |||
func unmarshalAmino(i *big.Int, text string) (err error) { | |||
if i == nil { |
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.
Do we want to merge this code?
types/int.go
Outdated
@@ -53,32 +64,39 @@ func marshalJSON(i *big.Int) ([]byte, error) { | |||
|
|||
// UnmarshalJSON for custom decoding scheme | |||
func unmarshalJSON(i *big.Int, bz []byte) error { | |||
if i == nil { |
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.
Do we want to merge this code?
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.
Oh woops, glad you caught that
Codecov Report
@@ Coverage Diff @@
## develop #1388 +/- ##
==========================================
- Coverage 64.66% 64.46% -0.2%
==========================================
Files 112 112
Lines 6282 6303 +21
==========================================
+ Hits 4062 4063 +1
- Misses 1997 2015 +18
- Partials 223 225 +2 |
Just realized big.Rat isn't stored via pointer. Should I change that in this PR too? |
Sure. |
Done! |
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.
utACK
* types/int: Switch Int, Uint to use pointers internally This reduces the amount of pointer refs & derefs. * Fix nil pointers on unmarshalling amino * Fix elusive bug in marshalling with unitialized big int * Remove debug code * Switch big.rat to use pointers internally
This reduces the amount of pointer refs & derefs.
I forgot to update the changelog for gaiad unsafe reset all, so I did that here as well.