Skip to content

Refactor spider_all function for improved efficiency and readability#3

Merged
ppfeister merged 5 commits intoppfeister:masterfrom
VainXploits:master
Jul 21, 2024
Merged

Refactor spider_all function for improved efficiency and readability#3
ppfeister merged 5 commits intoppfeister:masterfrom
VainXploits:master

Conversation

@VainXploits
Copy link
Copy Markdown
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.
Comment thread tests/__init__.py Outdated
Comment thread src/oculus/handler.py Outdated
Comment thread src/oculus/handler.py
Comment thread src/oculus/handler.py Outdated
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
Copy Markdown
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