You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
The text was updated successfully, but these errors were encountered:
sporkmonger
changed the title
Optimize Lookup Performance
Switch permission checks to use a HashSet
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 aHashSet
. This change is expected to reduce the complexity of the domain check from O(n) to O(1).Benefits
Considerations
This issue was prompted by a pull request review discussion: #253 (comment)
The text was updated successfully, but these errors were encountered: