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

Switch permission checks to use a HashSet #254

Open
coderabbitai bot opened this issue Apr 6, 2024 · 0 comments
Open

Switch permission checks to use a HashSet #254

coderabbitai bot opened this issue Apr 6, 2024 · 0 comments

Comments

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 6, 2024

Description

The function currently uses a Vec to store and check allowed HTTP domains. This approach allows domains to be duplicated. While not likely to lead to issues, it's inelegant.

Suggestion

Switch the data structure from a Vec to a HashSet. This change is expected to reduce the complexity of the domain check from O(n) to O(1).

Benefits

  • Slightly improved lookup performance for allowed HTTP domains.
  • Avoid duplicated domain entries

Considerations

  • Ensure compatibility and minimal impact on existing functionality.

This issue was prompted by a pull request review discussion: #253 (comment)

@sporkmonger sporkmonger changed the title Optimize Lookup Performance Switch permission checks to use a HashSet Apr 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants