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

.length yields the fixed length of the byte array (read-only). so I think checkpoints.length++ is pointless, Can you explain its intention?I'm confused,thank you! #46

Open
17Damon opened this issue Dec 3, 2017 · 1 comment

Comments

@17Damon
Copy link

17Damon commented Dec 3, 2017

Checkpoint storage newCheckPoint = checkpoints[ checkpoints.length++ ];

@nateawelch
Copy link

The length of an array isn't read only, you can update it like you can any other value. That line is essentially doing a .push(), but I believe it's cheaper than doing so.

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

No branches or pull requests

3 participants
@nateawelch @17Damon and others