Skip to content

Use set-backed tracking for faster duplicate argument checks#124

Open
Stephen0512 wants to merge 1 commit intobastikr:masterfrom
Stephen0512:master
Open

Use set-backed tracking for faster duplicate argument checks#124
Stephen0512 wants to merge 1 commit intobastikr:masterfrom
Stephen0512:master

Conversation

@Stephen0512
Copy link

This PR improves argument deduplication by introducing a set for faster membership checks while still maintaining a list to preserve the original argument order.

The previous implementation relied solely on a list to track seen arguments, which preserved order but required repeated O(n) membership checks. Using a set enables O(1) average-time lookups without changing existing behavior.

The issue was identified during an ongoing research project.

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

Successfully merging this pull request may close these issues.

1 participant