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

Minor tidy up #339

Merged
merged 2 commits into from
Jun 14, 2022
Merged

Minor tidy up #339

merged 2 commits into from
Jun 14, 2022

Conversation

Vectorized
Copy link
Collaborator

@Vectorized Vectorized commented Jun 14, 2022

Changes:

  • Lint
  • Refactored _boolToUint256 with the shifting into a _nextInitializedFlag function.
    The line is too long and triggers my OCD,
    and we can put the duplicated bitwise shifting stuff into the function.
  • Break up some long comments into multiple lines.
  • Changed _currentIndex = startTokenId + quantity; to _currentIndex = end;. Saves 1 gas.

Comments:

After some consideration, I've decided not to use assembly for the mint loop for now.
I know it saves 30 gas per iteration (0.4% savings for a batch of 10),
but it is hard to make it look pretty with all the magic numbers.
Anyway, ETH is cheap now.

@Vectorized Vectorized requested a review from cygaar June 14, 2022 22:34
@Vectorized Vectorized merged commit 0906c79 into chiru-labs:main Jun 14, 2022
@Vectorized Vectorized deleted the opt6 branch July 18, 2022 00:05
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