-
Notifications
You must be signed in to change notification settings - Fork 447
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
Remove list comprehension from str.join
function calls
#7433
Comments
@Solomon1732 thank you for your contributions to improving Tribler's code quality. If it's not too much trouble, could you kindly convert this issue into a pull request? This way, we could avoid duplication of work, as it would save us the step of implementing the string replacements that you've described. Plus, we could run tests on the modified code to ensure its correctness. |
No problem. I would be glad to 😄 |
Describe the bug
Thanks to generator expressions and other lazy evaluation functions (such as
map
), there's no need to build a list when callingstr.join
. This saves memory during runtime since no list is built. Below each relevant line I wrote a substitute I offer.tribler/src/tribler/core/components/libtorrent/torrentdef.py
Line 306 in 8df8154
tribler/src/tribler/core/components/libtorrent/torrentdef.py
Line 386 in 8df8154
tribler/src/tribler/core/components/metadata_store/remote_query_community/payload_checker.py
Line 104 in 8df8154
tribler/src/tribler/core/components/libtorrent/restapi/downloads_endpoint.py
Line 53 in 8df8154
The text was updated successfully, but these errors were encountered: