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

Feature request: update element key #181

Open
kaber2 opened this issue Nov 21, 2021 · 1 comment
Open

Feature request: update element key #181

kaber2 opened this issue Nov 21, 2021 · 1 comment

Comments

@kaber2
Copy link

kaber2 commented Nov 21, 2021

For SortedKeyList, it would be nice to have a more optimized way of updating an item's key than doing remove + add.

A few things that come to mind would be:

  • determining whether there is no position change and in that case do nothing
  • searching only maxes before/after the changed element for the new insertion point
  • avoiding list shrinking and enlargement if the element will end up in the same sublist
@grantjenks
Copy link
Owner

These are good ideas and I’ve thought about it before. Can you propose an API as one or more methods to support?

@grantjenks grantjenks changed the title Feature Request: update element key Feature request: update element key Oct 9, 2022
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

2 participants