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

Implement Attributes::remove with IndexMap::swap_remove #53

Merged
merged 1 commit into from
May 15, 2024

Conversation

rillian
Copy link
Contributor

@rillian rillian commented May 14, 2024

Use the explicit call instead of the deprecated remove method. This has the same behaviour as the previous call, so there is no change to the public API.

The intent it so make explicit that the call swaps the last element in the map into the place of the removed element, which is O(1), vs. shift_remove which maintains ordering but is O(n).

Addresses a deprecation warning with indexmap v2.2.6.

Use the explicit call instead of the deprecated `remove` method.
This has the same behaviour as the previous call, so there is
no change to the public API.

The intent it so make explicit that the call swaps the last
element in the map into the place of the removed element,
which is O(1), vs. `shift_remove` which maintains ordering
but is O(n).

Addresses a deprecation warning with indexmap v2.2.6.
@rillian rillian self-assigned this May 14, 2024
@rillian rillian requested a review from a team as a code owner May 14, 2024 15:59
@antonok-edm antonok-edm merged commit 4453dc8 into main May 15, 2024
3 checks passed
@antonok-edm antonok-edm deleted the swap_remove branch May 15, 2024 23:59
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.

2 participants