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

refactoring maps code on set comprehension #417

Merged
merged 4 commits into from
Jun 13, 2024
Merged

refactoring maps code on set comprehension #417

merged 4 commits into from
Jun 13, 2024

Conversation

ArtemIsmagilov
Copy link
Contributor

  1. bytecode faster
  2. the code is easier
  3. speed finding elements in set O (1) (hashable elemets)

@tobixen
Copy link
Member

tobixen commented Jun 13, 2024

Seems good to use set rather than list, but I will have to review this one a bit more carefully.

@ArtemIsmagilov
Copy link
Contributor Author

look example

print(' sa asd asd\r\n \f \t dad as as , asd'.split())
['sa', 'asd', 'asd', 'dad', 'as', 'as', ',', 'asd']

@ArtemIsmagilov
Copy link
Contributor Author

This method is used only in 2 places to search for a string, set is suitable here. Map, filter and lambda are unnecessary here. For library users, nothing should change.

@tobixen tobixen merged commit 3031145 into python-caldav:master Jun 13, 2024
8 checks passed
@ArtemIsmagilov ArtemIsmagilov deleted the refac-extract_auth_types branch June 13, 2024 18:32
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