Artemis: Refactor and Optimize Multiple Classes for Readability and Performance #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several commits that enhance the readability and efficiency of various classes in the codebase. Key changes include:
Code Formatting Cleanup: Removed unnecessary blank lines in the test suite to improve readability without affecting functionality.
String Operations Refactor: Optimized
str_reverse
andpalindrome
methods in theStrOps
class using Python's slicing for better performance and clarity.DoubleForLoop Class Optimization: Refactored methods to eliminate nested loops, improving performance from O(n^2) to O(n) and enhancing code readability.
DsList Class Improvements: Simplified list manipulation methods using list comprehensions and built-in functions, making the code more Pythonic and efficient.
Sort Class Enhancements: Replaced custom sorting and partitioning algorithms with built-in Python functionalities to streamline operations and improve performance.
SQL Query Refactor: Enhanced SQL query safety with parameterized queries, optimized joins, and improved resource management, resulting in better performance and security.
Prime Number Functions Optimization: Improved the
Primes
class methods for checking prime status, summing primes, and factorization, leading to significant performance gains, especially for larger numbers.Overall, these changes collectively enhance the maintainability, readability, and performance of the codebase.