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

Refactor spider_all function for improved efficiency and readability #3

Merged
merged 5 commits into from
Jul 21, 2024

Conversation

VainXploits
Copy link
Contributor

  • Refactored the spider_all function to enhance performance and code clarity.
  • Replaced lists with sets for queries_made and new_queries to allow O(1) average time complexity for membership checks and automatic deduplication.
  • Used set operations to simplify the logic for collecting and processing unique, spiderable queries.
  • Ensured new queries were efficiently filtered and processed without reprocessing already made queries.
  • Improved overall readability and maintainability of the function.

This change optimizes the function by leveraging set operations, making the code more concise and efficient.

Refactored the spider_all function to enhance performance and code clarity.

- Replaced lists with sets for queries_made and new_queries to allow O(1) average time complexity for membership checks and automatic deduplication.
- Used set operations to simplify the logic for collecting and processing unique, spiderable queries.
- Ensured new queries are efficiently filtered and processed without reprocessing already made queries.
- Improved overall readability and maintainability of the function.

This change optimizes the function by leveraging set operations, making the code more concise and efficient.
tests/__init__.py Outdated Show resolved Hide resolved
src/oculus/handler.py Outdated Show resolved Hide resolved
src/oculus/handler.py Show resolved Hide resolved
src/oculus/handler.py Outdated Show resolved Hide resolved
VainXploits

This comment was marked as duplicate.

VainXploits and others added 2 commits July 22, 2024 02:42
loglevel updated to LogLevel...

Co-authored-by: Paul Pfeister <code@pfeister.dev>
Co-authored-by: Paul Pfeister <code@pfeister.dev>
@VainXploits
Copy link
Contributor Author

Applied suggestions to code.

@ppfeister ppfeister added the refactor Refactors existing code label Jul 21, 2024
@ppfeister ppfeister merged commit f439d50 into ppfeister:master Jul 21, 2024
ppfeister added a commit that referenced this pull request Jul 21, 2024
Closes #3

Note: Original PR squashed for compliance with conventional commits

- Replaced lists with sets for queries_made and new_queries to allow O(1) average time complexity for membership checks and automatic deduplication.
- Used set operations to simplify the logic for collecting and processing unique, spiderable queries.
- Ensured new queries are efficiently filtered and processed without reprocessing already made queries.
- Improved overall readability and maintainability of the function.

Co-authored-by: Anirudh Dilli <anirudhdilli@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Refactors existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants