new92 / InstaTools

🧰 A collection of tools used for automating tasks on Instagram 📱| Written in Python 🐍 | Don't forget to ⭐ the repo !
https://github.com/new92/InstaTools
MIT License
115 stars 23 forks source link

Optimized sub-optimal code. #14

Closed ghost closed 11 months ago

ghost commented 11 months ago

Made the following changes:

-> replaced un-changed lists by tuples for better runtime & memory savings. -> removed str conversion ahead of input as it always returns a string. -> optimized for loops & converted un-changed list comprehensions into generator for better memory savings. -> removed unnecessary '!=0' references in if-blocks. -> removed unnecessary 'return None' statements. -> converted classic strings formatting into f-strings for better runtime. -> switched '.lower().strip()' -> '.strip().lower()' for better runtime. -> other minor optimizations.