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

types/int: Switch Int, Uint to use pointers internally #1388

Merged
merged 6 commits into from
Jun 27, 2018

Conversation

ValarDragon
Copy link
Contributor

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.

  • Updated all relevant documentation in docs - n/a?
  • Updated all code comments where relevant - n/a?
  • Wrote tests - n/a?
  • Updated CHANGELOG.md
  • Updated Gaia/Examples - n/a
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link

codecov bot commented Jun 26, 2018

Codecov Report

Merging #1388 into develop will decrease coverage by 0.19%.
The diff coverage is 41.02%.

@@            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

@ValarDragon
Copy link
Contributor Author

ValarDragon commented Jun 26, 2018

Just realized big.Rat isn't stored via pointer. Should I change that in this PR too?

@cwgoes
Copy link
Contributor

cwgoes commented Jun 26, 2018

Just realized big.Rat isn't stored via pointer. Should I change that in this PR too?

Sure.

@ValarDragon
Copy link
Contributor Author

Done!

Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

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

utACK

@cwgoes cwgoes merged commit d6df6b0 into develop Jun 27, 2018
@cwgoes cwgoes deleted the dev/switch_ints_to_pointers branch June 27, 2018 01:10
adrianbrink pushed a commit that referenced this pull request Jul 2, 2018
* 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
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.

2 participants