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

Reduce number of len calls #71

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

blankRiot96
Copy link

Hey, I was looking through the source code and happened to come across this really small efficiency improvement opportunity. Basically instead of getting the length of the iterable every iteration and subtracting one from it to get the last index, I thought it may be better to calculate it outside the for-in loop.
First time here 👀

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.

None yet

1 participant